]> arthur.barton.de Git - netdata.git/commitdiff
Merge pull request #1022 from Chocobo1/cppcheck
authorCosta Tsaousis <costa@tsaousis.gr>
Mon, 26 Sep 2016 13:17:32 +0000 (16:17 +0300)
committerGitHub <noreply@github.com>
Mon, 26 Sep 2016 13:17:32 +0000 (16:17 +0300)
Fix warnings found by cppcheck

1  2 
src/proc_net_softnet_stat.c

index b504532276c990d72085add25e13bb0abf709706,007d97938f65fabed9430a3657d889e5b4834da0..b013158639b8d2aa3f351b5ef0a81d19d213caf7
@@@ -41,16 -41,16 +41,16 @@@ int do_proc_net_softnet_stat(int update
  
      if(lines > 200) lines = 200;
      if(words > 50) words = 50;
-     
      if(unlikely(!data || lines > allocated_lines || words > allocated_columns)) {
          freez(data);
          allocated_lines = lines;
          allocated_columns = words;
          data = mallocz((allocated_lines + 1) * allocated_columns * sizeof(uint32_t));
      }
-     
      // initialize to zero
-     bzero(data, (allocated_lines + 1) * allocated_columns * sizeof(uint32_t));
+     memset(data, 0, (allocated_lines + 1) * allocated_columns * sizeof(uint32_t));
  
      // parse the values
      for(l = 0; l < lines ;l++) {
      if(do_per_core) {
          for(l = 0; l < lines ;l++) {
              char id[50+1];
 -            snprintfz(id, 50, "cpu%d_softnet_stat", l);
 +            snprintfz(id, 50, "cpu%u_softnet_stat", l);
  
              st = rrdset_find_bytype("cpu", id);
              if(!st) {
                  char title[100+1];
 -                snprintfz(title, 100, "CPU%d softnet_stat", l);
 +                snprintfz(title, 100, "CPU%u softnet_stat", l);
  
                  st = rrdset_create("cpu", id, NULL, "softnet_stat", NULL, title, "events/s", 4101 + l, update_every, RRDSET_TYPE_LINE);
                  for(w = 0; w < allocated_columns ;w++)