rest_api: strtoul canot return negative
>>> CID 307538: Control flow issues (NO_EFFECT)
>>> This less-than-zero comparison of an unsigned value is never true. "map_id < 0UL".
Closes: CID#307538
Change-Id: Ic5019e216dd7b26be0bd988df218a2cb5775e411
diff --git a/src/server/rest_api.c b/src/server/rest_api.c
index d3279c4..6e025ad 100644
--- a/src/server/rest_api.c
+++ b/src/server/rest_api.c
@@ -410,7 +410,7 @@
goto err;
}
map_id = strtoul(slotmap_id_str, NULL, 10);
- if (map_id < 0) {
+ if (map_id == ULONG_MAX && errno != 0) {
status = 400;
goto err;
}