changeset 8072:ceb88c0a1abb

[gaim-migrate @ 8770] the 0-byte-string trick doesn't work on non-gcc compilers. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 11 Jan 2004 06:10:22 +0000
parents 4dede940939c
children 2b396aefe321
files src/stringref.c src/stringref.h
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/stringref.c	Sun Jan 11 03:23:55 2004 +0000
+++ b/src/stringref.c	Sun Jan 11 06:10:22 2004 +0000
@@ -46,7 +46,7 @@
 	if (value == NULL)
 		return NULL;
 
-	newref = g_malloc(sizeof(GaimStringref) + strlen(value) + 1);
+	newref = g_malloc(sizeof(GaimStringref) + strlen(value));
 	strcpy(newref->value, value);
 	newref->ref = 1;
 
@@ -60,7 +60,7 @@
 	if (value == NULL)
 		return NULL;
 
-	newref = g_malloc(sizeof(GaimStringref) + strlen(value) + 1);
+	newref = g_malloc(sizeof(GaimStringref) + strlen(value));
 	strcpy(newref->value, value);
 	newref->ref = 0x80000000;
 
--- a/src/stringref.h	Sun Jan 11 03:23:55 2004 +0000
+++ b/src/stringref.h	Sun Jan 11 06:10:22 2004 +0000
@@ -42,7 +42,7 @@
 					 *   for GC at the next idle handler...
 					 *   But you aren't going to touch this
 					 *   anyway, right? */
-	char value[0];	/**< The string contained in this ref.
+	char value[1];	/**< The string contained in this ref.
 					 *   Notice that it is simply "hanging
 					 *   off the end" of the ref ... this
 					 *   is to save an allocation. */