Summary: | segfault in "qmicli -d /dev/cdc-wdm2 --nas-get-system-info" | ||
---|---|---|---|
Product: | libqmi | Reporter: | Jeroen Massar <jeroen> |
Component: | libqmi | Assignee: | Dan Williams <dcbw> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | minor | ||
Priority: | medium | CC: | aleksander |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Jeroen Massar
2013-01-21 14:42:44 UTC
With your change in...
> MCC: '123'
> MNC: '12?'
how come you got the '?' here?
(In reply to comment #1) > With your change in... > > > MCC: '123' > > MNC: '12?' > > how come you got the '?' here? Like because of UTF-8 as all my terminals are configured to use that. It is -1 according to gdb, maybe the datatype of the variable causes it, though 0xff would be an unknown char...
> > With your change in...
> >
> > > MCC: '123'
> > > MNC: '12?'
> >
> > how come you got the '?' here?
>
> Like because of UTF-8 as all my terminals are configured to use that.
>
> It is -1 according to gdb, maybe the datatype of the variable causes it,
> though 0xff would be an unknown char...
But wouldn't it only be printing two chars?
if (mnc[2] == 0xFF)
g_print ("\t\tMNC: '%c%c'\n", mnc[0], mnc[1]);
(In reply to comment #3) > > > > With your change in... > > > > > > > MCC: '123' > > > > MNC: '12?' > > > > > > how come you got the '?' here? > > > > Like because of UTF-8 as all my terminals are configured to use that. > > > > It is -1 according to gdb, maybe the datatype of the variable causes it, > > though 0xff would be an unknown char... > > But wouldn't it only be printing two chars? > > if (mnc[2] == 0xFF) > g_print ("\t\tMNC: '%c%c'\n", mnc[0], mnc[1]); Oh, sign issue maybe? Try with: if ((guchar)mnc[2] == 0xFF) (In reply to comment #4) > (In reply to comment #3) > > > > > > With your change in... > > > > > > > > > MCC: '123' > > > > > MNC: '12?' > > > > > > > > how come you got the '?' here? > > > > > > Like because of UTF-8 as all my terminals are configured to use that. > > > > > > It is -1 according to gdb, maybe the datatype of the variable causes it, > > > though 0xff would be an unknown char... > > > > But wouldn't it only be printing two chars? > > > > if (mnc[2] == 0xFF) > > g_print ("\t\tMNC: '%c%c'\n", mnc[0], mnc[1]); > > Oh, sign issue maybe? Try with: > if ((guchar)mnc[2] == 0xFF) Indeed that's the problem. So the print with .2 or .3 is ok, it's just that it does never get into the if() Will change that. Fixed in commit 9e60ef6c0f3e6ac579fb360481488c5ed00382cc. (In reply to comment #6) > Fixed in commit 9e60ef6c0f3e6ac579fb360481488c5ed00382cc. Great! I love seeing that bugs (even a trivial one like this ;) get fixed quickly, thanks and keep up the work! (now for the package to go officially into debian, until then the package from alioth works fine) |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.