[PHP-DEV] CVS update: php3/tests From: cschneid (php-dev <email protected>)
Date: 11/23/98

Date: Monday November 23, 1998 @ 13:13
Author: cschneid

Update of /repository/php3/tests
In directory asf:/u2/tmp/cvs-serv3598/tests

Modified Files:
        pack.phtml
Log Message:
Functions pack() and unpack() rewritten to be binary and buffer overrun
safe and behave like the Perl functions for all implemented format codes.

Index: php3/tests/pack.phtml
diff -c php3/tests/pack.phtml:1.2 php3/tests/pack.phtml:1.3
*** php3/tests/pack.phtml:1.2 Wed Feb 4 19:02:52 1998
--- php3/tests/pack.phtml Mon Nov 23 13:13:09 1998
***************
*** 4,10 ****
          $totry = "echo " . $thing . ";";
          eval($totry);
          echo "' (hex ";
! $totry = 'echo pack("h", ' . $thing . ');';
          eval($totry);
          echo ")\n";
    }
--- 4,10 ----
          $totry = "echo " . $thing . ";";
          eval($totry);
          echo "' (hex ";
! $totry = '$a = unpack("H*", ' . $thing . '); echo($a[""]);';
          eval($totry);
          echo ")\n";
    }
***************
*** 13,19 ****
    echotest('pack("c4",65,66,67,68)');
    echotest('pack("s2",1,2)');
    echotest('pack("N2",1,2)');
! echotest('pack("a4", "abcd", "x", "y", "z")');
    echotest('pack("aaaa", "abcd", "x", "y", "z")');
    echotest('pack("a14", "abcdefg")');
    echotest('pack("a4 <email protected>", "hi")');
--- 13,19 ----
    echotest('pack("c4",65,66,67,68)');
    echotest('pack("s2",1,2)');
    echotest('pack("N2",1,2)');
! echotest('pack("a4", "abcd")');
    echotest('pack("aaaa", "abcd", "x", "y", "z")');
    echotest('pack("a14", "abcdefg")');
    echotest('pack("a4 <email protected>", "hi")');

--
PHP Development Mailing List   http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe <email protected>
For help: php-dev-help <email protected>