Permalink
Browse files

Fixed sigabrt on 32bit ubuntu 11.10

  • Loading branch information...
1 parent 58fe9d9 commit daea4e0d57ae7092a70abfbeb5c3acee41158469 @kuebk kuebk committed Jan 26, 2012
Showing with 2 additions and 5 deletions.
  1. +2 −5 base64.cc
View
@@ -135,11 +135,8 @@ base64_encode_binding(const Arguments &args)
);
}
else if (args[0]->IsString()) {
- Local<String> v8str = args[0]->ToString();
- char * buffer = (char *) malloc(v8str->Utf8Length());
- v8str->WriteUtf8(buffer);
- str = base64_encode((unsigned char *)buffer, strlen(buffer));
- free(buffer);
+ String::Utf8Value v8str (args[0]->ToString());
+ str = base64_encode((unsigned char *) *v8str, v8str.length());
}
else
return VException("Argument should be a buffer or a string");

0 comments on commit daea4e0

Please sign in to comment.