[client] config: window width & height are unsigned values

This commit is contained in:
Geoffrey McRae 2021-09-11 10:30:31 +10:00
parent e249106ddf
commit 3cefe9f9b5

View File

@ -751,7 +751,7 @@ static bool optSizeParse(struct Option * opt, const char * str)
if (!str) if (!str)
return false; return false;
if (sscanf(str, "%dx%d", &g_params.w, &g_params.h) == 2) if (sscanf(str, "%ux%u", &g_params.w, &g_params.h) == 2)
{ {
if (g_params.w < 1 || g_params.h < 1) if (g_params.w < 1 || g_params.h < 1)
return false; return false;
@ -770,9 +770,9 @@ static StringList optSizeValues(struct Option * opt)
static char * optSizeToString(struct Option * opt) static char * optSizeToString(struct Option * opt)
{ {
int len = snprintf(NULL, 0, "%dx%d", g_params.w, g_params.h); int len = snprintf(NULL, 0, "%ux%u", g_params.w, g_params.h);
char * str = malloc(len + 1); char * str = malloc(len + 1);
sprintf(str, "%dx%d", g_params.w, g_params.h); sprintf(str, "%ux%u", g_params.w, g_params.h);
return str; return str;
} }