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:
Kevin Harwell
2013-08-30 15:39:09 +00:00
parent 9bed50db41
commit 1d3d6e0661

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