1
0
mirror of https://github.com/Yubico/yubico-pam.git synced 2025-01-31 16:52:19 +01:00

move around to avoid warning

This commit is contained in:
Klas Lindfors 2013-09-18 15:37:24 +02:00
parent 16a4dc768b
commit 2f69fb99e5

2
util.c
View File

@ -216,8 +216,8 @@ get_user_challenge_file(YK_KEY *yk, const char *chalresp_path, const char *usern
/* 0xffffffff == 4294967295 == 10 digits */
len = strlen(chalresp_path == NULL ? "challenge" : username) + 1 + 10 + 1;
if ((filename = malloc(len)) != NULL) {
filename_malloced = 1;
int res = snprintf(filename, len, "%s-%i", chalresp_path == NULL ? "challenge" : username, serial);
filename_malloced = 1;
if (res < 0 || res > len) {
/* Not enough space, strangely enough. */
filename = NULL;