comparison common/listutil.c @ 178:b0579d4fa186

Made macro MAX_FILESIZE saver with brackets. A perror debugging line.
author Bernhard Reiter <bernhard@intevation.de>
date Tue, 25 Mar 2014 17:21:40 +0100
parents 0798b9e35725
children 881ce5126f07
comparison
equal deleted inserted replaced
177:c92297bcda8f 178:b0579d4fa186
20 #include <polarssl/pk.h> 20 #include <polarssl/pk.h>
21 #include <polarssl/base64.h> 21 #include <polarssl/base64.h>
22 #include <polarssl/sha256.h> 22 #include <polarssl/sha256.h>
23 #pragma GCC diagnostic pop 23 #pragma GCC diagnostic pop
24 24
25 #define MAX_FILESIZE MAX_LINE_LENGTH * MAX_LINES 25 #define MAX_FILESIZE (MAX_LINE_LENGTH * MAX_LINES)
26 26
27 /** 27 /**
28 * @brief Read a file into memory. 28 * @brief Read a file into memory.
29 * 29 *
30 * The caller needs to free data 30 * The caller needs to free data
190 if (ret == READ_FILE_TOO_LARGE) { 190 if (ret == READ_FILE_TOO_LARGE) {
191 return TooLarge; 191 return TooLarge;
192 } 192 }
193 if (ret == READ_FILE_UNREADABLE) { 193 if (ret == READ_FILE_UNREADABLE) {
194 /* TODO: work with errno ? */ 194 /* TODO: work with errno ? */
195 /* errsv = errno; */
196 /* perror("read_and_verify_list(), READ_FILE_UNREADABLE:"); */
195 return SeekFailed; 197 return SeekFailed;
196 } 198 }
197 if (ret == READ_FILE_READ_FAILED) { 199 if (ret == READ_FILE_READ_FAILED) {
198 /* TODO: work with ferror() or feof() ? */ 200 /* TODO: work with ferror() or feof() ? */
199 return ReadFailed; 201 return ReadFailed;

http://wald.intevation.org/projects/trustbridge/