summaryrefslogtreecommitdiff
path: root/firmware/common/structec.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common/structec.c')
-rw-r--r--firmware/common/structec.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/firmware/common/structec.c b/firmware/common/structec.c
index 7c76874692..1f4205c67c 100644
--- a/firmware/common/structec.c
+++ b/firmware/common/structec.c
@@ -17,6 +17,7 @@
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19 19
20#include <ctype.h>
20#include <string.h> 21#include <string.h>
21#include <inttypes.h> 22#include <inttypes.h>
22#include "structec.h" 23#include "structec.h"
@@ -82,9 +83,14 @@ void structec_convert(void *structure, const char *ecinst,
82 break; 83 break;
83 } 84 }
84 85
85 /* This should be never reached. */ 86 /* Skip N bytes, idea taken from metadata.c */
86 default: 87 default:
88 {
89 if (isdigit(*ecinst_ring))
90 buf += (*ecinst_ring - '0');
91
87 break; 92 break;
93 }
88 } 94 }
89 95
90 ecinst_ring++; 96 ecinst_ring++;
@@ -114,7 +120,9 @@ size_t structec_size(const char *ecinst)
114 case 'c': size += 1; break; 120 case 'c': size += 1; break;
115 case 's': size += 2; break; 121 case 's': size += 2; break;
116 case 'l': size += 4; break; 122 case 'l': size += 4; break;
117 default: break; 123 default:
124 if (isdigit(*ecinst))
125 size += (*ecinst - '0');
118 } 126 }
119 } while (*(++ecinst) != '\0'); 127 } while (*(++ecinst) != '\0');
120 128