]> Kevux Git Server - rit/commit
daemon: replace atoi() with strtoul_ui() and strtol_i()
authorUsman Akinyemi <usmanakinyemi202@gmail.com>
Thu, 24 Oct 2024 00:24:56 +0000 (00:24 +0000)
committerTaylor Blau <me@ttaylorr.com>
Thu, 24 Oct 2024 18:03:43 +0000 (14:03 -0400)
commitcc4023477f3c958b77c64b7f36f91b4f9d7c5a58
treebd61c6cec5ebe9ca7d6133b5771e69877e03dfd9
parent34b6ce9b30747131b6e781ff718a45328aa887d0
daemon: replace atoi() with strtoul_ui() and strtol_i()

Replace atoi() with strtoul_ui() for --timeout and --init-timeout
(non-negative integers) and with strtol_i() for --max-connections
(signed integers). This improves error handling and input validation
by detecting invalid values and providing clear error messages.
Update tests to ensure these arguments are properly validated.

Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
daemon.c
t/t5570-git-daemon.sh