Fix coverity defects

This commit is contained in:
Azim Khan 2018-06-06 03:44:03 +01:00
parent 33dd3236de
commit 1a8ef0772c

View File

@ -66,7 +66,7 @@ int main( int argc, char** argv )
char buf[BUFFER_LEN];
char *p = buf;
char *end = p + BUFFER_LEN;
char c;
int c;
if( argc != 2 )
{
@ -83,7 +83,7 @@ int main( int argc, char** argv )
}
while( ( c = fgetc( fp ) ) != EOF && p < end - 1 )
*p++ = c;
*p++ = (char)c;
*p = '\0';
if( p - buf != 0 )