comparison src/plugins/zlib/doveadm-zlib.c @ 14682:d0d7b810646b

Make sure we check all the functions' return values. Minor API changes to simplify this. Checked using a patched clang that adds attribute(warn_unused_result) to all functions. This commit fixes several error handling mistakes.
author Timo Sirainen <tss@iki.fi>
date Mon, 25 Jun 2012 01:14:03 +0300
parents ca37d1577291
children 7c058aa05b0a
comparison
equal deleted inserted replaced
14681:ca37d1577291 14682:d0d7b810646b
73 return FALSE; 73 return FALSE;
74 74
75 ret = read(fd, buf, sizeof(buf)-1); 75 ret = read(fd, buf, sizeof(buf)-1);
76 if (ret > 0) { 76 if (ret > 0) {
77 buf[ret] = '\0'; 77 buf[ret] = '\0';
78 str_lcase(buf); 78 (void)str_lcase(buf);
79 match = strstr(buf, " ok begin compression.") != NULL || 79 match = strstr(buf, " ok begin compression.") != NULL ||
80 strstr(buf, " compress deflate") != NULL; 80 strstr(buf, " compress deflate") != NULL;
81 } 81 }
82 (void)close(fd); 82 (void)close(fd);
83 return match; 83 return match;