* libmisc/loginprompt.c: Prefer snprintf to sprintf, even if a
small context indicates no issues.
This commit is contained in:
parent
37eec13774
commit
42e72c418d
@ -1,3 +1,8 @@
|
||||
2009-04-25 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* libmisc/loginprompt.c: Prefer snprintf to sprintf, even if a
|
||||
small context indicates no issues.
|
||||
|
||||
2009-04-25 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* src/faillog.c: Remove function calls from within assert().
|
||||
|
@ -156,8 +156,9 @@ void login_prompt (const char *prompt, char *name, int namesize)
|
||||
if (strchr (nvar, '=') != NULL) {
|
||||
envp[envc] = nvar;
|
||||
} else {
|
||||
envp[envc] = xmalloc (strlen (nvar) + 32);
|
||||
sprintf (envp[envc], "L%d=%s", count++, nvar);
|
||||
size_t len = strlen (nvar) + 32;
|
||||
envp[envc] = xmalloc (len);
|
||||
snprintf (envp[envc], len, "L%d=%s", count++, nvar);
|
||||
}
|
||||
}
|
||||
set_env (envc, envp);
|
||||
|
Loading…
Reference in New Issue
Block a user