projects
/
YACASL2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2b71404
)
メモリ確保時のサイズを修正
author
j8takagi
<j8takagi@nifty.com>
Sat, 13 Mar 2010 16:19:29 +0000
(
01:19
+0900)
committer
j8takagi
<j8takagi@nifty.com>
Sat, 13 Mar 2010 16:19:29 +0000
(
01:19
+0900)
src/cerr.c
patch
|
blob
|
history
diff --git
a/src/cerr.c
b/src/cerr.c
index
5443c3e
..
c0146a2
100644
(file)
--- a/
src/cerr.c
+++ b/
src/cerr.c
@@
-17,20
+17,18
@@
bool addcerrlist(int newerrc, CERRARRAY newerrv[])
assert(newerrc > 0 && newerrv != NULL);
if(cerr != NULL) {
assert(newerrc > 0 && newerrv != NULL);
if(cerr != NULL) {
- p = cerr;
- while (p != NULL) {
+ for(p = cerr; p != NULL; p = p->next) {
q = p;
q = p;
- p = p->next;
}
}
- if((p = q->next = malloc(sizeof(CERRLIST
*
))) == NULL) {
+ if((p = q->next = malloc(sizeof(CERRLIST))) == NULL) {
goto addcerrlisterr;
}
goto addcerrlisterr;
}
- } else if((p = cerr = malloc(sizeof(CERRLIST
*
))) == NULL) {
+ } else if((p = cerr = malloc(sizeof(CERRLIST))) == NULL) {
goto addcerrlisterr;
}
for(i = 0; i < newerrc; i++) {
p->err = &(newerrv[i]);
goto addcerrlisterr;
}
for(i = 0; i < newerrc; i++) {
p->err = &(newerrv[i]);
- if((p->next = malloc(sizeof(CERRLIST
*
))) == NULL) {
+ if((p->next = malloc(sizeof(CERRLIST))) == NULL) {
goto addcerrlisterr;
}
q = p;
goto addcerrlisterr;
}
q = p;