cdma: fix serving-system parsing for oddly-placed spaces

Sierra 580 returns "+CSS: 0, Z , 0" when not associated.  Handle that.
This commit is contained in:
Dan Williams
2009-07-22 07:42:05 -04:00
parent 354785f440
commit c307606e74

View File

@@ -513,10 +513,7 @@ serving_system_done (MMSerialPort *port,
if (strstr (reply, "+CSS: ")) if (strstr (reply, "+CSS: "))
reply += 6; reply += 6;
num = sscanf (reply, "%d, %c, %d", &class, &band, &sid); num = sscanf (reply, "%d , %c , %d", &class, &band, &sid);
if (num != 3)
num = sscanf (reply, "%d,%c,%d", &class, &band, &sid);
if (num == 3) { if (num == 3) {
/* Normalize */ /* Normalize */
class = CLAMP (class, 0, 4); class = CLAMP (class, 0, 4);