commit | b9ce0f10f38c74b468c4bc512b3cc82c4bba0e1b | [log] [tgz] |
---|---|---|
author | Elliott Hughes <enh@google.com> | Sat Apr 30 16:07:10 2016 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Sat Apr 30 16:07:10 2016 +0000 |
tree | 685332193607cd53e7a023072a626377e5f675c7 | |
parent | 7bdd6a8b5a24214ae9f8d47b0236c1bcd6319c89 [diff] | |
parent | defd249d3d54f6e86919ace8ea44934138aa1fb8 [diff] |
Merge "toolbox ps: replace strcpy with snprintf."
diff --git a/toolbox/ps.c b/toolbox/ps.c index 3b3c8a1..c129110 100644 --- a/toolbox/ps.c +++ b/toolbox/ps.c
@@ -151,7 +151,7 @@ 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) {