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)
|
||||||
{
|
{
|
||||||
|
if (ord==0) {
|
||||||
|
buffer[0]=0;
|
||||||
|
} else {
|
||||||
keyword_t kwd = ORD_KEYWORD(ord);
|
keyword_t kwd = ORD_KEYWORD(ord);
|
||||||
if (ord==0 || kwd==NOKEYWORD) {
|
if (kwd==NOKEYWORD) {
|
||||||
buffer[0]=0;
|
buffer[0]=0;
|
||||||
} else {
|
} else {
|
||||||
char * s = getcommand(ord);
|
char * s = getcommand(ord);
|
||||||
strncpy(buffer, s, size);
|
strncpy(buffer, s, size);
|
||||||
free(s);
|
free(s);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue