Build without warnings on-box

This commit is contained in:
df 2021-01-15 00:31:20 +00:00
parent 68c33866cd
commit 5aeab9da9d
2 changed files with 5 additions and 5 deletions

View File

@ -9,7 +9,7 @@ HDRS=
OBJS= $(SRCS:.c=.o) OBJS= $(SRCS:.c=.o)
CC=gcc CC=gcc
#CC=mipsel-linux-gcc #CC=mipsel-linux-gcc
CFLAGS=-g CFLAGS=-g -std=c99 -D_XOPEN_SOURCE=700
INCS= INCS=
LIBS=-lsqlite3 LIBS=-lsqlite3
WARN=-pedantic -Wall -W -Wnested-externs -Wpointer-arith -Wno-long-long WARN=-pedantic -Wall -W -Wnested-externs -Wpointer-arith -Wno-long-long

8
tvdb.c
View File

@ -48,12 +48,12 @@ struct episode {
void void
unescape(char *txt) unescape(char *txt)
{ {
int l = strlen(txt);
char *p = 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; unsigned char icode;
if (1 == sscanf( p, "&#%hhu;%n", &icode, &ll) || if (1 == sscanf( p, "&#%hhu;%n", &icode, &ll) ||
1 == sscanf( p, "&#%*[xX]%hhx;%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 */ { /* curly apostrophe, en dash, curly quotes */
HANDLE("\xe2\x80\x99", '\'', 2); HANDLE("\xe2\x80\x99", '\'', 2);
HANDLE("\xe2\x80\x93", '-', 2); HANDLE("\xe2\x80\x93", '-', 2);