CVS update: php3/functions

From: Date: Sun, 15 Nov 1998 08:07:07 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-2413@lists.php.net to get a copy of this message
Date: Sunday November 15, 1998 @ 3:07 Author: rasmus Update of /repository/php3/functions In directory asf:/u2/tmp/cvs-serv18100/functions Modified Files: formatted_print.c Log Message: Make printf/sprintf output binary safe Index: php3/functions/formatted_print.c diff -c php3/functions/formatted_print.c:1.41 php3/functions/formatted_print.c:1.42 *** php3/functions/formatted_print.c:1.41 Sat Nov 14 12:28:54 1998 --- php3/functions/formatted_print.c Sun Nov 15 03:07:06 1998 *************** *** 27,33 **** +----------------------------------------------------------------------+ */ ! /* $Id: formatted_print.c,v 1.41 1998/11/14 17:28:54 kara Exp $ */ #include <math.h> /* modf() */ #ifdef THREAD_SAFE --- 27,33 ---- +----------------------------------------------------------------------+ */ ! /* $Id: formatted_print.c,v 1.42 1998/11/15 08:07:06 rasmus Exp $ */ #include <math.h> /* modf() */ #ifdef THREAD_SAFE *************** *** 376,382 **** * */ static char * ! php3_formatted_print(HashTable *ht) { pval **args; int argc, size = 240, inpos = 0, outpos = 0; --- 376,382 ---- * */ static char * ! php3_formatted_print(HashTable *ht, int *len) { pval **args; int argc, size = 240, inpos = 0, outpos = 0; *************** *** 559,565 **** /* possibly, we have to make sure we have room for the terminating null? */ result[outpos]=0; ! return result; } --- 559,565 ---- /* possibly, we have to make sure we have room for the terminating null? */ result[outpos]=0; ! *len = outpos; return result; } *************** *** 567,578 **** PHP_FUNCTION(user_sprintf) { char *result; TLS_VARS; ! if ((result=php3_formatted_print(ht))==NULL) { RETURN_FALSE; } ! RETVAL_STRING(result,1); efree(result); } --- 567,579 ---- PHP_FUNCTION(user_sprintf) { char *result; + int len; TLS_VARS; ! if ((result=php3_formatted_print(ht,&len))==NULL) { RETURN_FALSE; } ! RETVAL_STRINGL(result,len,1); efree(result); } *************** *** 580,592 **** PHP_FUNCTION(user_printf) { char *result; TLS_VARS; ! if ((result=php3_formatted_print(ht))==NULL) { RETURN_FALSE; } if (php3_header()) ! PUTS(result); efree(result); } --- 581,596 ---- PHP_FUNCTION(user_printf) { char *result; + int len; TLS_VARS; + ! if ((result=php3_formatted_print(ht,&len))==NULL) { RETURN_FALSE; } + fprintf(stderr,"%d",len); if (php3_header()) ! PHPWRITE(result,len); efree(result); } -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#2413) next »