forked from github/server
kleines null-pointer problem.
This commit is contained in:
parent
8a9727e5f2
commit
87f6a9e390
|
@ -419,13 +419,17 @@ is_persistent(const order * ord)
|
||||||
char *
|
char *
|
||||||
write_order(const order * ord, const struct locale * lang, char * buffer, size_t size)
|
write_order(const order * ord, const struct locale * lang, char * buffer, size_t size)
|
||||||
{
|
{
|
||||||
keyword_t kwd = ORD_KEYWORD(ord);
|
if (ord==0) {
|
||||||
if (ord==0 || kwd==NOKEYWORD) {
|
|
||||||
buffer[0]=0;
|
buffer[0]=0;
|
||||||
} else {
|
} else {
|
||||||
char * s = getcommand(ord);
|
keyword_t kwd = ORD_KEYWORD(ord);
|
||||||
strncpy(buffer, s, size);
|
if (kwd==NOKEYWORD) {
|
||||||
free(s);
|
buffer[0]=0;
|
||||||
|
} else {
|
||||||
|
char * s = getcommand(ord);
|
||||||
|
strncpy(buffer, s, size);
|
||||||
|
free(s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue