]> arthur.barton.de Git - netdata.git/commitdiff
fix for format string signess
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 16 Jun 2016 22:09:13 +0000 (01:09 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 16 Jun 2016 22:09:13 +0000 (01:09 +0300)
src/apps_plugin.c

index a606e97884cda4ee0a4b59a37f8acbccabf05a30..5858c9ba5ba0133ff83648123e7fd2c320d2611c 100644 (file)
@@ -149,7 +149,7 @@ void free_debug(const char *file, int line, const char *function, void *ptr) {
        allocations.allocated -= size;
        allocations.allocations--;
 
-       debug(D_MEMORY, "MEMORY: freed %zu bytes for %s/%u@%s."
+       debug(D_MEMORY, "MEMORY: freed %zu bytes for %s/%d@%s."
                " Status: allocated %zu in %zu allocs."
                , size
                , function, line, file
@@ -171,7 +171,7 @@ void *realloc_debug(const char *file, int line, const char *function, void *ptr,
        allocations.allocated += size;
        allocations.allocated -= old_size;
 
-       debug(D_MEMORY, "MEMORY: Re-allocated from %zu to %zu bytes for %s/%u@%s."
+       debug(D_MEMORY, "MEMORY: Re-allocated from %zu to %zu bytes for %s/%d@%s."
                " Status: allocated %zu in %zu allocs."
                , old_size, size
                , function, line, file
@@ -377,16 +377,16 @@ struct target *get_users_target(uid_t uid)
                return NULL;
        }
 
-       snprintfz(w->compare, MAX_COMPARE_NAME, "%d", uid);
+       snprintfz(w->compare, MAX_COMPARE_NAME, "%u", uid);
        w->comparehash = simple_hash(w->compare);
        w->comparelen = strlen(w->compare);
 
-       snprintfz(w->id, MAX_NAME, "%d", uid);
+       snprintfz(w->id, MAX_NAME, "%u", uid);
        w->idhash = simple_hash(w->id);
 
        struct passwd *pw = getpwuid(uid);
        if(!pw)
-               snprintfz(w->name, MAX_NAME, "%d", uid);
+               snprintfz(w->name, MAX_NAME, "%u", uid);
        else
                snprintfz(w->name, MAX_NAME, "%s", pw->pw_name);
 
@@ -415,16 +415,16 @@ struct target *get_groups_target(gid_t gid)
                return NULL;
        }
 
-       snprintfz(w->compare, MAX_COMPARE_NAME, "%d", gid);
+       snprintfz(w->compare, MAX_COMPARE_NAME, "%u", gid);
        w->comparehash = simple_hash(w->compare);
        w->comparelen = strlen(w->compare);
 
-       snprintfz(w->id, MAX_NAME, "%d", gid);
+       snprintfz(w->id, MAX_NAME, "%u", gid);
        w->idhash = simple_hash(w->id);
 
        struct group *gr = getgrgid(gid);
        if(!gr)
-               snprintfz(w->name, MAX_NAME, "%d", gid);
+               snprintfz(w->name, MAX_NAME, "%u", gid);
        else
                snprintfz(w->name, MAX_NAME, "%s", gr->gr_name);
 
@@ -735,13 +735,13 @@ struct pid_stat *get_pid_entry(pid_t pid)
 
        all_pids[pid] = calloc(sizeof(struct pid_stat), 1);
        if(!all_pids[pid]) {
-               error("Cannot allocate %lu bytes of memory", (unsigned long)sizeof(struct pid_stat));
+               error("Cannot allocate %zu bytes of memory", (size_t)sizeof(struct pid_stat));
                return NULL;
        }
 
        all_pids[pid]->fds = calloc(sizeof(int), 100);
        if(!all_pids[pid]->fds)
-               error("Cannot allocate %ld bytes of memory", (unsigned long)(sizeof(int) * 100));
+               error("Cannot allocate %zu bytes of memory", (size_t)(sizeof(int) * 100));
        else all_pids[pid]->fds_size = 100;
 
        if(root_of_pids) root_of_pids->prev = all_pids[pid];