Check return code properly in fputs (< 0 is error).
This commit is contained in:
		@@ -176,7 +176,7 @@ int hmac_test(const EVP_MD *md, FILE *out, FILE *in)
 | 
			
		||||
		/* If no = or starts with [ (for [L=20] line) just copy */
 | 
			
		||||
		if (!p)
 | 
			
		||||
			{
 | 
			
		||||
			if (!fputs(olinebuf, out))
 | 
			
		||||
			if (fputs(olinebuf, out) < 0)
 | 
			
		||||
				goto error;
 | 
			
		||||
			continue;
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
 | 
			
		||||
 | 
			
		||||
	if (!rsa_test(out, in))
 | 
			
		||||
		{
 | 
			
		||||
		fprintf(stderr, "FATAL RSAVTEST file processing error\n");
 | 
			
		||||
		fprintf(stderr, "FATAL RSAGTEST file processing error\n");
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
@@ -174,7 +174,7 @@ int rsa_test(FILE *out, FILE *in)
 | 
			
		||||
		/* If no = or starts with [ (for [foo = bar] line) just copy */
 | 
			
		||||
		if (!p || *keyword=='[')
 | 
			
		||||
			{
 | 
			
		||||
			if (!fputs(olinebuf, out))
 | 
			
		||||
			if (fputs(olinebuf, out) < 0)
 | 
			
		||||
				goto error;
 | 
			
		||||
			continue;
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
@@ -135,7 +135,7 @@ int main(int argc, char **argv)
 | 
			
		||||
 | 
			
		||||
	if (!rsa_stest(out, in, Saltlen))
 | 
			
		||||
		{
 | 
			
		||||
		fprintf(stderr, "FATAL RSAVTEST file processing error\n");
 | 
			
		||||
		fprintf(stderr, "FATAL RSASTEST file processing error\n");
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
@@ -190,7 +190,7 @@ int rsa_stest(FILE *out, FILE *in, int Saltlen)
 | 
			
		||||
		/* If no = just copy */
 | 
			
		||||
		if (!p)
 | 
			
		||||
			{
 | 
			
		||||
			if (!fputs(olinebuf, out))
 | 
			
		||||
			if (fputs(olinebuf, out) < 0)
 | 
			
		||||
				goto error;
 | 
			
		||||
			continue;
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
@@ -193,7 +193,7 @@ int rsa_test(FILE *out, FILE *in, int Saltlen)
 | 
			
		||||
		/* If no = or starts with [ (for [foo = bar] line) just copy */
 | 
			
		||||
		if (!p || *keyword=='[')
 | 
			
		||||
			{
 | 
			
		||||
			if (!fputs(olinebuf, out))
 | 
			
		||||
			if (fputs(olinebuf, out) < 0)
 | 
			
		||||
				goto error;
 | 
			
		||||
			continue;
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user