From d443fff04362d12aee6e9fcf639eee5f359cdc79 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Sun, 10 Sep 2000 11:03:32 +0000 Subject: [PATCH] Fix double unpack bug --- ext/standard/pack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.50.1