From: Stanislav Malyshev Date: Sun, 10 Sep 2000 11:03:32 +0000 (+0000) Subject: Fix double unpack bug X-Git-Tag: php-4.0.3RC1~206 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d443fff04362d12aee6e9fcf639eee5f359cdc79;p=php Fix double unpack bug --- diff --git a/ext/standard/pack.c b/ext/standard/pack.c index 4476e60170..8e3a32d115 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -460,7 +460,7 @@ static long php_unpack(char *data, int size, int issigned, int *map) * Rather than depending on error-prone ordered lists or syntactically * unpleasant pass-by-reference, we return an object with named paramters * (like *_fetch_object()). Syntax is "f[repeat]name/...", where "f" is the - * formatter char (like pack()), "[repeatt]" is the optional repeater argument, + * formatter char (like pack()), "[repeat]" is the optional repeater argument, * and "name" is the name of the variable to use. * Example: "c2chars/nints" will return an object with fields * chars1, chars2, and ints. @@ -732,7 +732,7 @@ PHP_FUNCTION(unpack) case 'd': { double v; - memcpy(&v, &input[inputpos], sizeof(float)); + memcpy(&v, &input[inputpos], sizeof(double)); add_assoc_double(return_value, n, v); break; }