Created
March 30, 2018 01:49
-
-
Save paulblei/9755aacbab8aefe7b1fd0072694d7d86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned long ruby_strtoul(const char *str, char **endptr, int base); | |
#define STRTOUL(str, endptr, base) (ruby_strtoul((str), (endptr), (base))) | |
// .... | |
static VALUE | |
pack_pack(int argc, VALUE *argv, VALUE ary) | |
{ | |
// ... | |
long len, idx, plen; | |
// .... | |
else if (ISDIGIT(*p)) { | |
errno = 0; | |
len = STRTOUL(p, (char**)&p, 10); | |
if (errno) { | |
rb_raise(rb_eRangeError, "pack length too big"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment