Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #19 from andys/master

Reading file was crashing on binary files (eg. containing nulls)
  • Loading branch information...
commit adc4c8493fee425e97ec779e21ef3aa7f799110a 2 parents 761afed + 4075dc1
@jmstacey authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 ext/rubyfuse_lib.c
View
5 ext/rubyfuse_lib.c
@@ -706,10 +706,9 @@ rf_open(const char *path, struct fuse_file_info *fi) {
/* We have the body, now save it the entire contents to our
* opened_file lists. */
newfile = ALLOC(opened_file);
- value = StringValueCStr(body);
- newfile->size = strlen(value);
+ newfile->size = RSTRING_LEN(body);
newfile->value = ALLOC_N(char,(newfile->size)+1);
- memcpy(newfile->value,value,newfile->size);
+ memcpy(newfile->value,RSTRING_PTR(body),newfile->size);
newfile->value[newfile->size] = '\0';
newfile->writesize = 0;
newfile->zero_offset = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.