Ticket #3856 (closed defect: fixed)
comparison between pointer and zero character constant
| Reported by: | egmont | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 4.8.20 |
| Component: | mc-core | Version: | master |
| Keywords: | Cc: | ||
| Blocked By: | #3780 | Blocking: | |
| Branch state: | no branch | Votes for changeset: |
Description
gcc-7.2 caught this:
CC boxes.lo
boxes.c: In function ‘jobs_fill_listbox’:
boxes.c:431:22: warning: comparison between pointer and zero character constant [-Wpointer-compare]
if (state_str[0] == '\0')
^~
boxes.c:431:9: note: did you mean to dereference the pointer?
if (state_str[0] == '\0')
^
It's indeed right, the code is buggy. It should be state_str[0][0].
Attachments
Change History
comment:1 Changed 8 years ago by egmont
... or maybe like this (see attached patch)?
(I haven't tried runtime, just compiled it :))
comment:3 Changed 8 years ago by andrew_b
This is already fixed in 3780_cleanup: b2bbd326e0aa77df8aa48b4a1b4fd25bbbb7a40a.
Note: See
TracTickets for help on using
tickets.
