From 5aeab9da9d1428ee484351f048573c28218c7b22 Mon Sep 17 00:00:00 2001 From: df Date: Fri, 15 Jan 2021 00:31:20 +0000 Subject: [PATCH] Build without warnings on-box --- Makefile | 2 +- tvdb.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index aebbbe4..b04f625 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ HDRS= OBJS= $(SRCS:.c=.o) CC=gcc #CC=mipsel-linux-gcc -CFLAGS=-g +CFLAGS=-g -std=c99 -D_XOPEN_SOURCE=700 INCS= LIBS=-lsqlite3 WARN=-pedantic -Wall -W -Wnested-externs -Wpointer-arith -Wno-long-long diff --git a/tvdb.c b/tvdb.c index 5210bed..53bb8a5 100644 --- a/tvdb.c +++ b/tvdb.c @@ -48,12 +48,12 @@ struct episode { void unescape(char *txt) { - int l = strlen(txt); char *p = txt; + int l = strlen(txt); - for (; p = strchr(p, '&'); p++) + for (; (p = strchr(p, '&')); p++) { - size_t ll; + int ll; unsigned char icode; if (1 == sscanf( p, "&#%hhu;%n", &icode, &ll) || 1 == sscanf( p, "&#%*[xX]%hhx;%n", &icode, &ll)) { @@ -68,7 +68,7 @@ unescape(char *txt) } } - for (p = txt; p = memchr(p, '\xe2', l - (p - txt)); p++) + for (p = txt; (p = memchr(p, '\xe2', l - (p - txt))); p++) { /* curly apostrophe, en dash, curly quotes */ HANDLE("\xe2\x80\x99", '\'', 2); HANDLE("\xe2\x80\x93", '-', 2);