readprofile: use snprintf() rather than sprintf()

This commit is contained in:
Karel Zak 2021-07-27 13:31:57 +02:00
parent 34cf0aa56d
commit 914966e925
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ static FILE *myopen(char *name, char *mode, int *flag)
if (!strcmp(name + len - 3, ".gz")) {
FILE *res;
char *cmdline = xmalloc(len + 6);
sprintf(cmdline, "zcat %s", name);
snprintf(cmdline, len + 6, "zcat %s", name);
res = popen(cmdline, mode);
free(cmdline);
*flag = 1;