зеркало из https://github.com/github/putty.git
64-bit cleanness: fix a couple of format strings in winjump.c.
strcspn() returns a size_t, which is not safe to pass as the parameter in a printf argument list corresponding to a "*" field width specifier in the format string, because the latter should be int, which may not be the same size as size_t.
This commit is contained in:
Родитель
a5d7a6c102
Коммит
ef7a821bb1
|
@ -445,7 +445,8 @@ static IShellLink *make_shell_link(const char *appname,
|
||||||
sessionname, "'", NULL);
|
sessionname, "'", NULL);
|
||||||
} else {
|
} else {
|
||||||
assert(appname);
|
assert(appname);
|
||||||
desc_string = dupprintf("Run %.*s", strcspn(appname, "."), appname);
|
desc_string = dupprintf("Run %.*s",
|
||||||
|
(int)strcspn(appname, "."), appname);
|
||||||
}
|
}
|
||||||
ret->lpVtbl->SetDescription(ret, desc_string);
|
ret->lpVtbl->SetDescription(ret, desc_string);
|
||||||
sfree(desc_string);
|
sfree(desc_string);
|
||||||
|
@ -461,7 +462,8 @@ static IShellLink *make_shell_link(const char *appname,
|
||||||
pv.pszVal = dupstr(sessionname);
|
pv.pszVal = dupstr(sessionname);
|
||||||
} else {
|
} else {
|
||||||
assert(appname);
|
assert(appname);
|
||||||
pv.pszVal = dupprintf("Run %.*s", strcspn(appname, "."), appname);
|
pv.pszVal = dupprintf("Run %.*s",
|
||||||
|
(int)strcspn(appname, "."), appname);
|
||||||
}
|
}
|
||||||
pPS->lpVtbl->SetValue(pPS, &PKEY_Title, &pv);
|
pPS->lpVtbl->SetValue(pPS, &PKEY_Title, &pv);
|
||||||
sfree(pv.pszVal);
|
sfree(pv.pszVal);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче