This is the mail archive of the ecos-bugs@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug 1002110] New: vfscanf does not support "hh" conversion


Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1002110

            Bug ID: 1002110
           Summary: vfscanf does not support "hh" conversion
           Product: eCos
           Version: 3.0
            Target: All
 Architecture/Host_ Other
                OS:
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: low
         Component: C library
          Assignee: unassigned@bugs.ecos.sourceware.org
          Reporter: 414256we@gmail.com
        QA Contact: ecos-bugs@ecos.sourceware.org
                CC: ecos-bugs@ecos.sourceware.org

While the standard said:
h      Indicates  that the conversion will be one of d, i, o, u, x, X, or n and
the next pointer is a pointer to a short int or unsigned short int
              (rather than int).

hh     As for h, but the next pointer is a pointer to a signed char or unsigned
char.
The C library in eCos implements as follow:
again:
c = *fmt++
switch (c) {
...
case 'h':
        flags |= SHORT;
        goto again;
...
}
it results that it treat "hh" as "h". 
When we try to did something like this:
unsigned char c;
sscanf(str, "%hhx", &c);
a segmentfault was generated.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]