diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ispeek.c | 2 | ||||
-rw-r--r-- | src/util.c | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/ispeek.c b/src/ispeek.c index 9e4f8e3..82837c6 100644 --- a/src/ispeek.c +++ b/src/ispeek.c @@ -143,13 +143,13 @@ print_file(const char *path, struct closure *cl) char *str = NULL; size_t len = 0; grecs_asprint_locus(&str, &len, &json_err_locus); die(EX_DATAERR, "%s: %s", str, json_err_diag); } - while (key = *argv++) { + while ((key = *argv++)) { struct json_value *p; char *s; if (print_options & PRINT_NAME) printf("%s%s", key, delim); p = json_value_lookup(obj, key); @@ -75,13 +75,13 @@ translate_ids(int argc, char **argv, const char *mapname) } } char * eclat_stpcpy(char *p, char *q) { - while (*p = *q++) + while ((*p = *q++)) ++p; return p; } #define RESOURCE_ID_PFX "resource-id=" #define RESOURCE_ID_LEN (sizeof(RESOURCE_ID_PFX) - 1) @@ -229,13 +229,12 @@ eclat_send_request(struct ec2_request *orig, struct grecs_node **ret_tree) int ret = 0; struct curl_slist *headers; struct eclat_io *io; time_t endtime; unsigned long tts, t; struct grecs_node *xmltree = NULL; - void *sim; endtime = time(NULL) + max_retry_time; tts = 2; while (1) { struct grecs_node *node; struct ec2_request *req; @@ -444,13 +443,13 @@ read_file(const char *file) if (strcmp(file, "-") == 0) { struct grecs_txtacc *acc = grecs_txtacc_create(); char inbuf[4096]; size_t n; - while (n = fread(inbuf, 1, sizeof(inbuf), stdin)) + while ((n = fread(inbuf, 1, sizeof(inbuf), stdin)) > 0) grecs_txtacc_grow(acc, inbuf, n); grecs_txtacc_grow_char(acc, 0); if (ferror(stdin)) die(EX_NOINPUT, "read error"); grecs_txtacc_grow_char(acc, 0); buf = grecs_txtacc_finish(acc, 1); |