From d94d9720a10b5d17547225b28912a2017d205bc8 Mon Sep 17 00:00:00 2001 From: witekfl Date: Sun, 19 Sep 2010 14:13:28 +0200 Subject: [PATCH] Use snprintf instead of sprintf. One warning less. --- src/util/file.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/file.h b/src/util/file.h index 5f279b99..df985aa4 100644 --- a/src/util/file.h +++ b/src/util/file.h @@ -170,9 +170,9 @@ stat_user(struct string *string, struct stat *stp) if (!pwd || !pwd->pw_name) /* ulongcat() can't pad from right. */ - sprintf(last_user, "%-8d", (int) stp->st_uid); + snprintf(last_user, 64, "%-8d", (int) stp->st_uid); else - sprintf(last_user, "%-8.8s", pwd->pw_name); + snprintf(last_user, 64, "%-8.8s", pwd->pw_name); last_uid = stp->st_uid; } @@ -199,9 +199,9 @@ stat_group(struct string *string, struct stat *stp) if (!grp || !grp->gr_name) /* ulongcat() can't pad from right. */ - sprintf(last_group, "%-8d", (int) stp->st_gid); + snprintf(last_group, 64, "%-8d", (int) stp->st_gid); else - sprintf(last_group, "%-8.8s", grp->gr_name); + snprintf(last_group, 64, "%-8.8s", grp->gr_name); last_gid = stp->st_gid; } -- 2.11.4.GIT