2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Use strtok_r() instead of strtok()

This commit is contained in:
Todd C. Miller
2015-06-19 12:35:51 -06:00
parent 048e251ae0
commit e2328479dd
14 changed files with 47 additions and 32 deletions

View File

@@ -646,7 +646,7 @@ send_mail(const char *fmt, ...)
break;
case 0:
{
char *argv[MAX_MAILFLAGS + 1];
char *last, *argv[MAX_MAILFLAGS + 1];
char *mflags, *mpath = def_mailerpath;
int i;
@@ -673,10 +673,10 @@ send_mail(const char *fmt, ...)
argv[0] = mpath;
i = 1;
if ((p = strtok(mflags, " \t"))) {
if ((p = strtok_r(mflags, " \t", &last))) {
do {
argv[i] = p;
} while (++i < MAX_MAILFLAGS && (p = strtok(NULL, " \t")));
} while (++i < MAX_MAILFLAGS && (p = strtok_r(NULL, " \t", &last)));
}
argv[i] = NULL;