From: Jens Rehsack <[email protected]>

---
 src/wsputil.c |   24 ++++++++++++++++++++----
 1 Datei geändert, 20 Zeilen hinzugefügt(+), 4 Zeilen entfernt(-)

diff --git a/src/wsputil.c b/src/wsputil.c
index 1b2b2b7..ece58e6 100644
--- a/src/wsputil.c
+++ b/src/wsputil.c
@@ -490,13 +490,26 @@ gboolean wsp_decode_application_id(struct wsp_header_iter 
*iter,
        unsigned int val_len;
        unsigned int i;
 
+       switch (wsp_header_iter_get_val_type(iter)) {
+       case WSP_VALUE_TYPE_TEXT:
+               if (out_value)
+                       *out_value = pdu_val;
+
+               break;
+
        /*
         * Well-known field values MUST be encoded using the
         * compact binary formats
         */
-       if (wsp_header_iter_get_val_type(iter) == WSP_VALUE_TYPE_SHORT) {
+       case WSP_VALUE_TYPE_SHORT:
                val = *pdu_val & 0x7f;
-       } else {
+
+               if (out_value)
+                       *out_value = get_text_entry(val, app_id);
+
+               break;
+
+       case WSP_VALUE_TYPE_LONG:
                val_len = wsp_header_iter_get_val_len(iter);
 
                if (val_len > 2)
@@ -504,10 +517,13 @@ gboolean wsp_decode_application_id(struct wsp_header_iter 
*iter,
 
                for (i = 0, val = 0; i < val_len && i < sizeof(val); i++)
                        val = (val << 8) | pdu_val[i];
+
+               if (out_value)
+                       *out_value = get_text_entry(val, app_id);
+
+               break;
        }
 
-       if (out_value)
-               *out_value = get_text_entry(val, app_id);
 
        return TRUE;
 }
-- 
1.7.10.1

_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to