Я хотел бы знать, каков безопасный / простой / правильный способ вызова snprintf?
#define 1024
char cwdir[SIZE];address[SIZE]
int n=0;
....
...
snprintf(path, sizeof(path), "%s/%i", address, n);
g cc 8.3 показывает
‘%i’ directive output may be truncated writing between 1 and 11 bytes into a region of size between 0 and 1023 [-Werror=format-truncation=]
snprintf(path, sizeof(path), "%s/%i", address, n);
^~
prog.c:272:2: note: ‘snprintf’ output between 3 and 1036 bytes into a destination of size 1024
snprintf(path, sizeof(path), "%s/%i", address, n);