Closed Bug 794051 Opened 8 years ago Closed 8 years ago
Invalid use of fscanf in Gonk
A call to fscanf in uses a wrong parameter to read a string. > /home/tdz/Projects/mozilla/src/mozilla-inbound/upstream/hal/gonk/GonkHal.cpp: In function 'void mozilla::hal_impl::GetCurrentBatteryInformation(mozilla::hal::BatteryInformation*)': > /home/tdz/Projects/mozilla/src/mozilla-inbound/upstream/hal/gonk/GonkHal.cpp:353: warning: format '%s' expects type 'char*', but argument 3 has type 'char (*)' The call should be replaced by fgets, which checks array bounds.
Summary: Invalid use of fscanf usage in GankHal.cpp → Invalid use of fscanf usage in GonkHal.cpp
Summary: Invalid use of fscanf usage in GonkHal.cpp → Invalid use of fscanf in GonkHal.cpp
(In reply to Thomas Zimmermann from comment #1) > Created attachment 664842 [details] [diff] [review] > Read battery status via fgets I verified that the phone still switches correctly among charging states.
Looks good. r=me if you squash the 2 patches into one.
Squashed and updated. Dave, please commit the patch if you're OK with it.
Attachment #664969 - Flags: review?(dhylands) → review+
Pushed to inbound https://hg.mozilla.org/integration/mozilla-inbound/rev/20169e3f33b3
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.