]> granicus.if.org Git - php/commitdiff
Fixed bug #31465 (False warning in unpack() when working with *).
authorIlia Alshanetsky <iliaa@php.net>
Tue, 25 Jan 2005 22:50:39 +0000 (22:50 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 25 Jan 2005 22:50:39 +0000 (22:50 +0000)
ext/standard/pack.c

index f41695c56249d4b41f3c9b45ea85a2c6a8482502..12395e920f5f7bb505adc3c970f338aef35662ed 100644 (file)
@@ -830,7 +830,9 @@ PHP_FUNCTION(unpack)
 
                                inputpos += size;
                                if (inputpos < 0) {
-                                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", type);
+                                       if (size != -1) { /* only print warning if not working with * */
+                                               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", type);
+                                       }
                                        inputpos = 0;
                                }
                        } else if (arg < 0) {