From b64e6827f700f296faf60c1f370e4e319ec755a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Wed, 28 May 2014 12:51:13 +0000 Subject: Steam: Fixed iterating over json arrays git-svn-id: http://svn.miranda-ng.org/main/trunk@9332 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Steam/src/Steam/friend.h | 2 +- protocols/Steam/src/Steam/friend_list.h | 2 +- protocols/Steam/src/Steam/poll.h | 2 +- protocols/Steam/src/Steam/search.h | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'protocols') diff --git a/protocols/Steam/src/Steam/friend.h b/protocols/Steam/src/Steam/friend.h index 00aceab272..a2c7780551 100644 --- a/protocols/Steam/src/Steam/friend.h +++ b/protocols/Steam/src/Steam/friend.h @@ -86,7 +86,7 @@ namespace SteamWebApi root = json_as_array(node); if (root != NULL) { - for (int i = 0;; i++) + for (size_t i = 0; i < json_size(root); i++) { child = json_at(root, i); if (child == NULL) diff --git a/protocols/Steam/src/Steam/friend_list.h b/protocols/Steam/src/Steam/friend_list.h index a7defd8b8e..80944f8ffe 100644 --- a/protocols/Steam/src/Steam/friend_list.h +++ b/protocols/Steam/src/Steam/friend_list.h @@ -63,7 +63,7 @@ namespace SteamWebApi root = json_as_array(node); if (root != NULL) { - for (int i = 0;; i++) + for (size_t i = 0; i < json_size(root); i++) { child = json_at(root, i); if (child == NULL) diff --git a/protocols/Steam/src/Steam/poll.h b/protocols/Steam/src/Steam/poll.h index c6f40cf749..42efeff8f1 100644 --- a/protocols/Steam/src/Steam/poll.h +++ b/protocols/Steam/src/Steam/poll.h @@ -129,7 +129,7 @@ namespace SteamWebApi root = json_as_array(node); if (root != NULL) { - for (int i = 0;; i++) + for (size_t i = 0; i < json_size(root); i++) { child = json_at(root, i); if (child == NULL) diff --git a/protocols/Steam/src/Steam/search.h b/protocols/Steam/src/Steam/search.h index 9ac4afcd4f..1efe0e807b 100644 --- a/protocols/Steam/src/Steam/search.h +++ b/protocols/Steam/src/Steam/search.h @@ -53,7 +53,7 @@ namespace SteamWebApi if ((searchResult->status = (HTTP_STATUS)response->resultCode) != HTTP_STATUS_OK) return; - JSONNODE *root = json_parse(response->pData), *node, *child;; + JSONNODE *root = json_parse(response->pData), *node, *child; node = json_get(root, "success"); searchResult->success = json_as_bool(node) > 0; @@ -73,7 +73,7 @@ namespace SteamWebApi root = json_as_array(node); if (root != NULL) { - for (int i = 0;; i++) + for (size_t i = 0; i < json_size(root); i++) { child = json_at(root, i); if (child == NULL) -- cgit v1.2.3