Browse Source

set default compiler/standard to C99

Unfortunately snprintf is not in C89. snprintf's size argument is also
no longer hardcoded.
master
Shokara 5 months ago
parent
commit
ab52d828a7
Signed by: shokara GPG Key ID: 7F5702DEF8E6DC82
  1. 4
      Makefile
  2. 2
      save.c

4
Makefile

@ -1,7 +1,7 @@
NAME=rssdl
CC=c89
CFLAGS=-O2 -std=c89 -g -I. -Wall -Wextra -pedantic -D_XOPEN_SOURCE=500
CC=c99
CFLAGS=-O2 -std=c99 -g -I. -Wall -Wextra -pedantic -D_XOPEN_SOURCE=500
CFILES=main.c fetch.c parse.c save.c hash.c gperf.c
LIBS=-lcurl -lmxml

2
save.c

@ -68,7 +68,7 @@ int save_feed_maildir(const char *feeddata, const char *maildir)
else
fprintf(stderr, "strptime failed when converting pubdate to epoch\n");
snprintf(path, 256, "tmp/%li.rssdl-tmp.%s:2,", epochsec, hostname);
snprintf(path, sizeof(path), "tmp/%li.rssdl-tmp.%s:2,", epochsec, hostname);
fp = fopen(path, "w");
if (!fp) {

Loading…
Cancel
Save