diff options
| author | Syndamia <kamen@syndamia.com> | 2023-12-07 10:59:52 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2023-12-07 10:59:52 +0200 |
| commit | bba64eb044562a88b7f93ab62eef62ea4fbb5cb4 (patch) | |
| tree | 1c2dafcbad9710865aa8ee8fe27c6b0df12a9aaf /util.c | |
| parent | 922694d1c64aec4419e9f472469eb32fb5e4f84e (diff) | |
| download | pico-web-bba64eb044562a88b7f93ab62eef62ea4fbb5cb4.tar pico-web-bba64eb044562a88b7f93ab62eef62ea4fbb5cb4.tar.gz pico-web-bba64eb044562a88b7f93ab62eef62ea4fbb5cb4.zip | |
[util] Added error handling function
Diffstat (limited to 'util.c')
| -rw-r--r-- | util.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -2,6 +2,16 @@ #include <arpa/inet.h> #include <stdlib.h> +#include <stdio.h> +#include <errno.h> + uint16_t inet_atop(const char *port) { return htons(atoi(port)); } + +void herr(int output, const char* funcName) { + if (output < 0) { + perror(funcName); + exit(errno); + } +} |
