mirror of
https://github.com/hak5/wifipineapple-openwrt.git
synced 2025-10-29 16:57:19 +00:00
mtd: fix md5sum error checking
In mtd_verify(), the return value of md5sum() has been interpreted as error if nonzero, while the function returns number of processed bytes, which caused mtd_verify() to always fail. This patch fixes error checking to interpret only negative values as errors. Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44605 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
d7a6866ce0
commit
8a9f7fdf7d
@ -337,7 +337,7 @@ mtd_verify(const char *mtd, char *file)
|
||||
if (quiet < 2)
|
||||
fprintf(stderr, "Verifying %s against %s ...\n", mtd, file);
|
||||
|
||||
if (stat(file, &s) || md5sum(file, f_md5)) {
|
||||
if (stat(file, &s) || md5sum(file, f_md5) < 0) {
|
||||
fprintf(stderr, "Failed to hash %s\n", file);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user