diff options
author | ubq323 <ubq323@ubq323.website> | 2022-10-28 02:02:13 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2022-10-28 02:02:13 +0100 |
commit | f56709bfcdad99a47d52196ba971ff1d41746289 (patch) | |
tree | adcba721fa4606ba919cc322454fa16df1aba938 /common.c | |
parent | e3013792ea7a4b05ea44ae29fb462ceba323b0e8 (diff) |
don't need common.c
Diffstat (limited to 'common.c')
-rw-r--r-- | common.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/common.c b/common.c deleted file mode 100644 index f217001..0000000 --- a/common.c +++ /dev/null @@ -1,31 +0,0 @@ -#include <stdio.h> -#include <string.h> - - -#define SOCKDIR "/run/apionet" - -int -channel_socket_path(char chname[], char out[], size_t lim) -{ - if (strlen(chname) > 16) return -1; - if (snprintf(out, lim, SOCKDIR "/apionet.%s.sock", chname) >= lim) - return -1; - return 0; -} - -char *channels[] = { - "a","b","robots","jonathan","secret-channel",NULL, -}; - -int -main() -{ - char b[200]; - for (int i = 0; channels[i]; i++) { - memset(b,0,200); - channel_socket_path(channels[i], b, 200); - printf("%s\n",b); - } - return 0; -} - |