1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-29 03:17:53 -04:00

Use snprintf instead of sprintf. One warning less.

This commit is contained in:
witekfl 2010-09-19 14:13:28 +02:00
parent cbf70d5304
commit d94d9720a1

View File

@ -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;
}