Check return value on fwrite

........

Merged revisions 398000 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398002 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin Harwell
2013-08-30 15:32:13 +00:00
parent 5474e48966
commit 0bcdb7f9ff
+5 -2
View File
@@ -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