/
githubmirror
/
glibc
Обзор
Документация
Войти
/
githubmirror
/
glibc
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
stdio-common/bug23.c
21 строка
466 B
Petr Baudis
Fix allocation when handling positional parameters in printf.
20 фев 2011, 15:59
20 фев 2011, 15:59
84a4211
Код
Авторство
О чём код?
#include <stdio.h> #include <string.h> static char buf[32768]; static const char expected[] = "\ \n\ a\n\ abbcd55%%%%%%%%%%%%%%%%%%%%%%%%%%\n"; static int do_test (void) { snprintf (buf, sizeof (buf), "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", "a", "b", "c", "d", 5); return strcmp (buf, expected) != 0; } #define TEST_FUNCTION do_test () #include "../test-skeleton.c"