Skip to content
Snippets Groups Projects

Fix static code analysis errors

Merged Vivek Dutta requested to merge static_code into devel
3 files
+ 11
8
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 9
6
@@ -263,13 +263,14 @@ static int prepare_stats_blob(struct blob_buf *b, struct qos_stats *stats, void
static int get_stats_by_ifname(struct blob_buf *b, struct qos_stats *stats, void *dd,
char *ifname, int qid)
{
int queues = 0;
int i, ret = 0;
int ret = 0;
if (qid >= 0) {
ret = prepare_stats_blob(b, stats, dd, ifname, qid);
} else {
queues = get_no_queues(ifname);
int i;
int queues = get_no_queues(ifname);
for (i = 0; i < queues; i++) {
ret = prepare_stats_blob(b, stats, dd, ifname, i);
if (ret != 0)
@@ -332,17 +333,19 @@ static int validate_keys(char *req_json)
int len = strlen(req_json);
for (i = 0; i < len; i++) {
char key[IFNAMSIZ] = {0};
if (req_json[i] == QUOTE) {
char key[IFNAMSIZ] = {0};
int j = 0;
i++;
while (req_json[i] != QUOTE) {
while ((i < len) && (req_json[i] != QUOTE)) {
key[j] = req_json[i];
j++;
i++;
}
i++;
while ((req_json[i] != SEPERATOR) && (i < len))
while ((i < len) && (req_json[i] != SEPERATOR))
i++;
if (!(!strncmp(key, PARAM1, strlen(PARAM1)) ||
Loading