From 93c941374ecee84b2e5cde62d13d8829b5843a38 Mon Sep 17 00:00:00 2001 From: "\"John Hawthorn ext:(%22)" Date: Thu, 1 Jan 2009 02:27:35 -0800 Subject: cleanup. Fix case of empty list. --- src/main.c | 7 ++++++- src/xlib.c | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 903ec1a..ddd559b 100644 --- a/src/main.c +++ b/src/main.c @@ -275,7 +275,7 @@ void run(){ } void readlist(FILE *f){ - int lsize = 1; + int lsize = 16; imageslen = 0; images = NULL; while(!feof(f)){ @@ -294,6 +294,10 @@ void readlist(FILE *f){ } lsize *= 2; } + if(!imageslen){ + fprintf(stderr, "No images to view\n"); + exit(EXIT_FAILURE); + } } int main(int argc, char *argv[]){ @@ -335,3 +339,4 @@ int main(int argc, char *argv[]){ return 0; } + diff --git a/src/xlib.c b/src/xlib.c index b8163a2..3025f16 100644 --- a/src/xlib.c +++ b/src/xlib.c @@ -144,6 +144,7 @@ void setaspect(unsigned int w, unsigned int h){ /* Alt-F4 silent. Keeps people happy */ int xquit(Display *d){ + (void)d; exit(EXIT_SUCCESS); return 0; } -- cgit v1.2.3