mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 11:32:25 +00:00
Check return value on fwrite
........ Merged revisions 398000 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 398002 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2089,7 +2089,7 @@ static int console_log_verbose(const char *s)
|
||||
|
||||
char prefix[80];
|
||||
const char *c = s;
|
||||
int res = 0;
|
||||
int num, res = 0;
|
||||
|
||||
do {
|
||||
if (VERBOSE_HASMAGIC(s)) {
|
||||
@@ -2127,7 +2127,10 @@ static int console_log_verbose(const char *s)
|
||||
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 at least some info has been written
|
||||
|
||||
Reference in New Issue
Block a user