Skip to content

Commit 89e5230

Browse files
committed
tests/generic_gpio_utest.c: fix casting for %u printing of literal numbers (via macro)
Signed-off-by: Jim Klimov <[email protected]>
1 parent 422805a commit 89e5230

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/generic_gpio_utest.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,9 @@ int main(int argc, char **argv) {
331331
* because scanf() does not support asterisk for
332332
* width specifier; have to create it on the fly.
333333
*/
334-
snprintf(fmt, sizeof(fmt), "%%%us", NUT_GPIO_CHIPNAMEBUF-1);
334+
snprintf(fmt, sizeof(fmt), "%%%us", (unsigned int)NUT_GPIO_CHIPNAMEBUF-1);
335335
fEof=fscanf(testData, fmt, chipNameLocal);
336-
snprintf(fmt, sizeof(fmt), "%%%us", NUT_GPIO_SUBTYPEBUF-1);
336+
snprintf(fmt, sizeof(fmt), "%%%us", (unsigned int)NUT_GPIO_SUBTYPEBUF-1);
337337
fEof=fscanf(testData, fmt, subType);
338338
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
339339
#pragma GCC diagnostic pop

0 commit comments

Comments
 (0)