diff --git a/sys/net/application_layer/nanocoap/sock.c b/sys/net/application_layer/nanocoap/sock.c index cdd7cb8f32..2132fa9e57 100644 --- a/sys/net/application_layer/nanocoap/sock.c +++ b/sys/net/application_layer/nanocoap/sock.c @@ -403,7 +403,7 @@ int nanocoap_sock_get_blockwise(nanocoap_sock_t *sock, const char *path, DEBUG("fetching block %u\n", num); int res = _fetch_block(sock, buf, sizeof(buf), path, blksize, num, &ctx); - if (res) { + if (res < 0) { DEBUG("error fetching block %u: %d\n", num, res); return res; }