diff options
author | "John Hawthorn ext:(%22) <jhawthor@uvic.ca> | 2009-01-01 02:27:35 -0800 |
---|---|---|
committer | "John Hawthorn ext:(%22) <jhawthor@uvic.ca> | 2009-01-01 02:27:35 -0800 |
commit | 93c941374ecee84b2e5cde62d13d8829b5843a38 (patch) | |
tree | ab95d1055e1952777e2857014cca74c4fd2ca77b /src | |
parent | 7b5eb765586d442f1fd77bbd6ae98e8276d28b20 (diff) | |
download | mirror-meh-93c941374ecee84b2e5cde62d13d8829b5843a38.tar.gz mirror-meh-93c941374ecee84b2e5cde62d13d8829b5843a38.tar.bz2 mirror-meh-93c941374ecee84b2e5cde62d13d8829b5843a38.zip |
cleanup. Fix case of empty list.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 7 | ||||
-rw-r--r-- | src/xlib.c | 1 |
2 files changed, 7 insertions, 1 deletions
@@ -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; } + @@ -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; } |