c-basic/warning.c

10 lines
191 B
C
Raw Normal View History

2022-11-24 23:00:34 +01:00
#include <stdio.h>
int main(){
char s[2];
// produce warning, char* s is too small for the following fgets instruction
fgets(s, 10, stdin);
printf("%s\n",s);
return 0;
}