General Public License for more details.
*/
-#include "includes.h"
+#include "config.h"
+
+#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
+#include <unistd.h>
#include "sprintf_alloc.h"
#include "file_util.h"
#include "md5.h"
#include "libbb/libbb.h"
-#undef strlen
#if defined HAVE_SHA256
#include "sha256.h"
md5sum_hex[i*2] = bin2hex[md5sum_bin[i] >> 4];
md5sum_hex[i*2+1] = bin2hex[md5sum_bin[i] & 0xf];
}
-
+
md5sum_hex[md5sum_hex_len] = '\0';
-
+
return md5sum_hex;
}
sha256sum_hex[i*2] = bin2hex[sha256sum_bin[i] >> 4];
sha256sum_hex[i*2+1] = bin2hex[sha256sum_bin[i] & 0xf];
}
-
+
sha256sum_hex[sha256sum_hex_len] = '\0';
-
+
return sha256sum_hex;
}
DIR *dir;
struct dirent *dent;
+ if (path == NULL) {
+ opkg_perror(ERROR, "Missing directory parameter");
+ return -1;
+ }
+
dir = opendir(path);
if (dir == NULL) {
opkg_perror(ERROR, "Failed to open dir %s", path);