osmocom-bb[master]: mobile/gsm322.c: check fwrite() return value

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed May 17 21:09:15 UTC 2017


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/2660/2/src/host/layer23/src/mobile/gsm322.c
File src/host/layer23/src/mobile/gsm322.c:

Line 5150: 			rc += fwrite(buf, 4, 1, fp);
I'm not sure if addition is a good idea.  Example: First fwrite() returns 3, second one returns -1.  Result is 2, which will make the below check "pass".  Using |= might work, as the highest (sign) bit would propagate and the result certainly be negative and not 2.


-- 
To view, visit https://gerrit.osmocom.org/2660
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I74ad6e540c98ab4914e7a2ea725dd23f5a2fd034
Gerrit-PatchSet: 2
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-HasComments: Yes



More information about the gerrit-log mailing list