fix for format string signess
Costa Tsaousis (ktsaou) committed
Jun 17, 2016 at 01:09 UTC
c876a8d92996311dbe8171a2426f836841c6050e
1 file changed
+10
-10
src/apps_plugin.c
+10
-10
@@ -149,7 +149,7 @@ void free_debug(const char *file, int line, const char *function, void *ptr) {
149
allocations.allocated -= size;
150
allocations.allocations--;
151
152
- debug(D_MEMORY, "MEMORY: freed %zu bytes for %s/%u@%s."
152
+ debug(D_MEMORY, "MEMORY: freed %zu bytes for %s/%d@%s."
153
" Status: allocated %zu in %zu allocs."
154
, size
155
, function, line, file
@@ -171,7 +171,7 @@ void *realloc_debug(const char *file, int line, const char *function, void *ptr,
171
allocations.allocated += size;
172
allocations.allocated -= old_size;
173
174
- debug(D_MEMORY, "MEMORY: Re-allocated from %zu to %zu bytes for %s/%u@%s."
174
+ debug(D_MEMORY, "MEMORY: Re-allocated from %zu to %zu bytes for %s/%d@%s."
175
" Status: allocated %zu in %zu allocs."
176
, old_size, size
177
, function, line, file
@@ -377,16 +377,16 @@ struct target *get_users_target(uid_t uid)
377
return NULL;
378
}
379
380
- snprintfz(w->compare, MAX_COMPARE_NAME, "%d", uid);
380
+ snprintfz(w->compare, MAX_COMPARE_NAME, "%u", uid);
381
w->comparehash = simple_hash(w->compare);
382
w->comparelen = strlen(w->compare);
383
384
- snprintfz(w->id, MAX_NAME, "%d", uid);
384
+ snprintfz(w->id, MAX_NAME, "%u", uid);
385
w->idhash = simple_hash(w->id);
386
387
struct passwd *pw = getpwuid(uid);
388
if(!pw)
389
- snprintfz(w->name, MAX_NAME, "%d", uid);
389
+ snprintfz(w->name, MAX_NAME, "%u", uid);
390
else
391
snprintfz(w->name, MAX_NAME, "%s", pw->pw_name);
392
@@ -415,16 +415,16 @@ struct target *get_groups_target(gid_t gid)
415
return NULL;
416
}
417
418
- snprintfz(w->compare, MAX_COMPARE_NAME, "%d", gid);
418
+ snprintfz(w->compare, MAX_COMPARE_NAME, "%u", gid);
419
w->comparehash = simple_hash(w->compare);
420
w->comparelen = strlen(w->compare);
421
422
- snprintfz(w->id, MAX_NAME, "%d", gid);
422
+ snprintfz(w->id, MAX_NAME, "%u", gid);
423
w->idhash = simple_hash(w->id);
424
425
struct group *gr = getgrgid(gid);
426
if(!gr)
427
- snprintfz(w->name, MAX_NAME, "%d", gid);
427
+ snprintfz(w->name, MAX_NAME, "%u", gid);
428
else
429
snprintfz(w->name, MAX_NAME, "%s", gr->gr_name);
430
@@ -735,13 +735,13 @@ struct pid_stat *get_pid_entry(pid_t pid)
735
736
all_pids[pid] = calloc(sizeof(struct pid_stat), 1);
737
if(!all_pids[pid]) {
738
- error("Cannot allocate %lu bytes of memory", (unsigned long)sizeof(struct pid_stat));
738
+ error("Cannot allocate %zu bytes of memory", (size_t)sizeof(struct pid_stat));
739
return NULL;
740
}
741
742
all_pids[pid]->fds = calloc(sizeof(int), 100);
743
if(!all_pids[pid]->fds)
744
- error("Cannot allocate %ld bytes of memory", (unsigned long)(sizeof(int) * 100));
744
+ error("Cannot allocate %zu bytes of memory", (size_t)(sizeof(int) * 100));
745
else all_pids[pid]->fds_size = 100;
746
747
if(root_of_pids) root_of_pids->prev = all_pids[pid];