--- ekg2-0.3.1/plugins/gg/commands.c.orig 2016-01-07 16:46:28.607770916 -0500 +++ ekg2-0.3.1/plugins/gg/commands.c 2016-01-07 16:52:07.119519571 -0500 @@ -1028,15 +1028,16 @@ static int token_gif_load (char *fname, char errbuf[512]; GifFileType *file; int fd; + int gifErrCode; fd = open(fname, O_RDONLY); if (fd == -1) { snprintf(errbuf, sizeof(errbuf), "open(%s): %m", fname); goto err; } - if (!(file = DGifOpenFileHandle(fd))) { + if (!(file = DGifOpenFileHandle(fd, &gifErrCode))) { snprintf(errbuf, sizeof(errbuf), "DGifOpenFileHandle(): %d", - GifLastError()); + GifErrorString(gifErrCode)); goto err2; } @@ -1046,7 +1047,7 @@ static int token_gif_load (char *fname, } if (DGifSlurp(file) != GIF_OK) { - snprintf(errbuf, sizeof(errbuf), "DGifSlurp(): %d", GifLastError()); + snprintf(errbuf, sizeof(errbuf), "DGifSlurp(): error"); goto err3; } @@ -1059,12 +1060,12 @@ static int token_gif_load (char *fname, token->data = (unsigned char *) xmalloc(token->sx * token->sy); memcpy(token->data, file->SavedImages[0].RasterBits, token->sx * token->sy); - DGifCloseFile(file); + DGifCloseFile(file, NULL); return 0; err3: - DGifCloseFile(file); + DGifCloseFile(file, NULL); err2: close(fd); err: