projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5738a80
)
(objc_read_string): Allocate n+1 chars instead of just n.
author
Kresten Krab Thorup
<krab@gcc.gnu.org>
Mon, 20 Sep 1993 10:27:23 +0000
(10:27 +0000)
committer
Kresten Krab Thorup
<krab@gcc.gnu.org>
Mon, 20 Sep 1993 10:27:23 +0000
(10:27 +0000)
From-SVN: r5371
gcc/objc/archive.c
patch
|
blob
|
history
diff --git
a/gcc/objc/archive.c
b/gcc/objc/archive.c
index 867b74977f3bbd5719869d84087c07c5eda4e846..ad822fad53f025a483b4d8d4b72209e9e429a087 100644
(file)
--- a/
gcc/objc/archive.c
+++ b/
gcc/objc/archive.c
@@
-627,10
+627,10
@@
objc_read_string (struct objc_typed_stream* stream,
unsigned int nbytes = buf[0]&_B_VALUE;
len = __objc_read_nbyte_uint(stream, nbytes, &nbytes);
if (len) {
- (*string) = (char*)__objc_xmalloc(nbytes);
+ (*string) = (char*)__objc_xmalloc(nbytes
+1
);
if (key)
hash_add (&stream->stream_table, (void*)key, *string);
- len = (*stream->read)(stream->physical, *string,
buf[0]&_B_VALUE
);
+ len = (*stream->read)(stream->physical, *string,
nbytes
);
(*string)[nbytes] = '\0';
}
}