diff options
| Commit | bba64eb044562a88b7f93ab62eef62ea4fbb5cb4 (patch) | |
|---|---|---|
| Author | 2023-12-07 10:59:52 +0200 | |
| Committer | 2023-12-07 10:59:52 +0200 | |
| Files | 1c2dafcbad9710865aa8ee8fe27c6b0df12a9aaf /util.c | |
| pico-web-bba64eb044562a88b7f93ab62eef62ea4fbb5cb4.tar pico-web-bba64eb044562a88b7f93ab62eef62ea4fbb5cb4.tar.gz pico-web-bba64eb044562a88b7f93ab62eef62ea4fbb5cb4.zip | ||
| Parent | 922694d1c64aec4419e9f472469eb32fb5e4f84e (diff) | |
[util] Added error handling function
1 files changed, 10 insertions, 0 deletions
| -rw-r--r-- | util.c | 10 |
@@ -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); + } +} |
