ini-parser: Fix size_t to ssize_t 97/288797/7
authorTaeminYeom <taemin.yeom@samsung.com>
Thu, 23 Feb 2023 07:51:13 +0000 (16:51 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 9 Mar 2023 07:55:35 +0000 (07:55 +0000)
Variable "n_read" brings the return of getline,
but return type of getline is ssize_t.
Also, fseek's second parameter is long type,
so it is proper to use signed data type.

Change-Id: I87f01a986a9b7fa68d7a675a1e31a0afe0c1f4bf
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
src/libcommon/ini-parser.c

index e7d7605..e8e2bce 100644 (file)
@@ -162,7 +162,7 @@ int libsys_config_parse_by_section(const char *fname, int cb(const struct parse_
        FILE *fp = NULL;
        char *line = NULL;
        size_t len = 0;
-       size_t n_read;
+       ssize_t n_read;
        int ret = 0;
        int retval;
        struct parse_result result = { 0, };