Hello David,

On 22.01.2014 17:05, David Laight wrote:
From: Stanislaw Wadas
Add error handling to fputs()/fgets() functions.
...
-       fputs(buf, fp);
+       if (fputs(buf, fp) == EOF) {
+               ERROR("write error");
+               fclose(fp);
+               return;
+       }
Pointless...
Most code that looks at the return value of fputs() or fprintf()
is broken.
What you probably want is:
        fputs(buf, fp);
        fflush(fp);
        err = ferror(fp);
        fclose(fp);
        if (err) ...
thank you for all your advice, they will be included in next patchset,
but I agree with Krzysztof and I have only left inline untouched.


Best regards
Stanislaw Wadas
        David



--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to