Fix: Report registered modems properly
authorDenis Kenzior <denkenz@gmail.com>
Sat, 26 Sep 2009 00:52:14 +0000 (19:52 -0500)
committerDenis Kenzior <denkenz@gmail.com>
Mon, 28 Sep 2009 16:18:50 +0000 (11:18 -0500)
src/modem.c

index c41e352..9dc7784 100644 (file)
@@ -857,13 +857,13 @@ const char **__ofono_modem_get_list()
 
        modems = g_new0(const char *, g_slist_length(g_modem_list) + 1);
 
-       for (l = g_modem_list, i = 0; l; l = l->next, i++) {
+       for (l = g_modem_list, i = 0; l; l = l->next) {
                modem = l->data;
 
                if (modem->driver == NULL)
                        continue;
 
-               modems[i] = modem->path;
+               modems[i++] = modem->path;
        }
 
        return modems;