caget shows incorrect output for binary integers
Bug #1418526 reported by
mdavidsaver
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EPICS Base |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Richard Fearn reports
> `caget -lb` outputs an empty string if the value of the PV is zero.
>
> The algorithm in sprint_long never modifies the ret array if val is zero, since no set bit is ever encountered.
Related branches
lp:~richardfearn/epics-base/caget-lb-zero-fix
- mdavidsaver: Approve
-
Diff: 36 lines (+15/-11)1 file modifiedsrc/catools/tool_lib.c (+15/-11)
Changed in epics-base: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
With a test .db file
> record(longin, "x") {}
> record(ai,"y") {}
With VAL=0 I see
> $ caget -lb x
> x 0
> $ caget -lb y
> y
> $ caget -0b x
> x
> $ caget -0b y
> y 0
With VAL=4 I see
> $ caget -lb x
> x 4
> $ caget -lb y
> y 100
> $ caget -0b x
> x 100
> $ caget -0b y
> y 4
Does anyone else find this behavior confusing?