iliaa           Sat Feb 24 17:57:57 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/exif   exif.c 
  Log:
  
  Pad to given length, not replace data with spaces
  
http://cvs.php.net/viewvc.cgi/php-src/ext/exif/exif.c?r1=1.173.2.5.2.15&r2=1.173.2.5.2.16&diff_format=u
Index: php-src/ext/exif/exif.c
diff -u php-src/ext/exif/exif.c:1.173.2.5.2.15 
php-src/ext/exif/exif.c:1.173.2.5.2.16
--- php-src/ext/exif/exif.c:1.173.2.5.2.15      Sat Feb 24 17:40:45 2007
+++ php-src/ext/exif/exif.c     Sat Feb 24 17:57:57 2007
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: exif.c,v 1.173.2.5.2.15 2007/02/24 17:40:45 iliaa Exp $ */
+/* $Id: exif.c,v 1.173.2.5.2.16 2007/02/24 17:57:57 iliaa Exp $ */
 
 /*  ToDos
  *
@@ -142,7 +142,7 @@
 };
 /* }}} */
 
-#define EXIF_VERSION "1.4 $Id: exif.c,v 1.173.2.5.2.15 2007/02/24 17:40:45 
iliaa Exp $"
+#define EXIF_VERSION "1.4 $Id: exif.c,v 1.173.2.5.2.16 2007/02/24 17:57:57 
iliaa Exp $"
 
 /* {{{ PHP_MINFO_FUNCTION
  */
@@ -1004,18 +1004,21 @@
                        if (ret && len)  {
                                strlcpy(ret, tag_table[i].Desc, abs(len));
                                if (len < 0) {
-                                       memset(ret, ' ', -len - 1);
+                                       memset(ret + strlen(ret), ' ', -len - 
strlen(ret) - 1);
+                                       ret[-len] = '\0';
                                }
                                return ret;
                        }
                        return tag_table[i].Desc;
                }
        }
+
        if (ret && len) {
                snprintf(tmp, sizeof(tmp), "UndefinedTag:0x%04X", tag_num);
                strlcpy(ret, tmp, abs(len));
                if (len < 0) {
-                       memset(ret, ' ', -len - 1);
+                       memset(ret + strlen(ret), ' ', -len - strlen(ret) - 1);
+                       ret[-len] = '\0';
                }
                return ret;
        }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to