Merge "toolbox ps: replace strcpy with snprintf."

This commit is contained in:
Elliott Hughes 2016-04-30 16:07:10 +00:00 committed by Gerrit Code Review
commit b9ce0f10f3

View file

@ -151,7 +151,7 @@ static int ps_line(int pid, int tid)
if (pw == 0 || (display_flags & SHOW_NUMERIC_UID)) {
snprintf(user, sizeof(user), "%d", (int)stats.st_uid);
} else {
strcpy(user, pw->pw_name);
snprintf(user, sizeof(user), "%s", pw->pw_name);
}
if (ppid_filter != 0 && ppid != ppid_filter) {