Previously, the while loop ensured that meta was NULL, causing the for
loop to never been executed. This introduces a new temporary variable to
avoid changing meta before the for loop.
CID: 37960
* meta => [ { name => <name>, value => <value> }, ... ]
* }
*/
-static int av2notification_meta(pTHX_ AV *array, notification_meta_t **ret_meta) {
+static int av2notification_meta(pTHX_ AV *array,
+ notification_meta_t **ret_meta) {
notification_meta_t *tail = NULL;
int len = av_len(array);
static int notification_meta2av(pTHX_ notification_meta_t *meta, AV *array) {
int meta_num = 0;
-
- while (meta) {
+ for (notification_meta_t *m = meta; m != NULL; m = m->next) {
++meta_num;
- meta = meta->next;
}
av_extend(array, meta_num);