]> granicus.if.org Git - php/commitdiff
(php3_sybase_get_column_content) initialize buffer before call to dbconvert()
authorThies C. Arntzen <thies@php.net>
Fri, 5 Nov 1999 08:48:09 +0000 (08:48 +0000)
committerThies C. Arntzen <thies@php.net>
Fri, 5 Nov 1999 08:48:09 +0000 (08:48 +0000)
@- Fixed garbage returned at the end of certain Sybase-Columns (Thies)
@  Patch submitted by: neal@wanlink.com

ext/sybase/sybase.c

index 95a48562b7ef4208cb4a47ced89b25cff0b3a5cc..afc0239b534f3a568bf7ffc3d4e2e6e66ff1b08f 100644 (file)
@@ -620,6 +620,9 @@ static void php3_sybase_get_column_content(sybase_link *sybase_ptr,int offset,pv
                                }
 
                                res_buf = (char *) emalloc(res_length+1);
+                               memset(res_buf,' ',res_length+1);  /* XXX i'm sure there's a better way
+                                                                                                         but i don't have sybase here to test
+                                                                                                         991105 thies@digicol.de  */
                                dbconvert(NULL,coltype(offset),dbdata(sybase_ptr->link,offset), res_length,SYBCHAR,res_buf,-1);
                
                                /* get rid of trailing spaces */