Permalink
Browse files

Fix ugly possible segfault.

  • Loading branch information...
1 parent 202a458 commit a48dc55c4108d36406ad1f10542a63fe729dc487 @Themaister committed Oct 30, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 file.c
View
2 file.c
@@ -510,7 +510,7 @@ void load_ram_file(const char *path, int type)
void *buf = NULL;
ssize_t rc = read_file(path, &buf);
if (rc <= size)
- memcpy(data, buf, size);
+ memcpy(data, buf, rc);
free(buf);
}

0 comments on commit a48dc55

Please sign in to comment.