Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# flashmap
Automatically exported from code.google.com/p/flashmap

Added the pending pull request over at the main github site since noone else seems to bother.

# prerequisites (debian-based distros)

apt-get install checkinstall -y

# install (debian)

make clean && make && checkinstall

# uninstall (debian)

dpkg -r flashmap
3 changes: 2 additions & 1 deletion fmap_csum.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ void print_csum(uint8_t *digest, size_t len)
char *str;
char tmp[3];
unsigned int i;
char size = sizeof(str);

str = malloc((len * 2) + 1);
memset(str, '\0', sizeof(str));
memset(str, '\0', size);
for (i = 0; i < len; i++) {
snprintf(tmp, 3, "%02x", digest[i]);
strncat(str, tmp, 3);
Expand Down
2 changes: 1 addition & 1 deletion lib/fmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ int fmap_get_csum(const uint8_t *image, unsigned int image_len, uint8_t **digest
int fmap_offset;
SHA_CTX ctx;

if ((image == NULL))
if (image == NULL)
return -1;

if ((fmap_offset = fmap_find(image, image_len)) < 0)
Expand Down