mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-09 11:28:25 +00:00
Check return value on fwrite
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@398000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1950,7 +1950,7 @@ static int console_log_verbose(const char *s)
|
|||||||
|
|
||||||
char prefix[80];
|
char prefix[80];
|
||||||
const char *c = s;
|
const char *c = s;
|
||||||
int res = 0;
|
int num, res = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (VERBOSE_HASMAGIC(s)) {
|
if (VERBOSE_HASMAGIC(s)) {
|
||||||
@@ -1988,7 +1988,10 @@ static int console_log_verbose(const char *s)
|
|||||||
fputs(prefix, stdout);
|
fputs(prefix, stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
fwrite(c, sizeof(char), s - c, stdout);
|
num = s - c;
|
||||||
|
if (fwrite(c, sizeof(char), num, stdout) < num) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (!res) {
|
if (!res) {
|
||||||
/* if at least some info has been written
|
/* if at least some info has been written
|
||||||
|
|||||||
Reference in New Issue
Block a user