cgo

[Fork] Gopher Client
git clone https://git.jojolepro.com/cgo.git
Log | Files | Refs | README | LICENSE

commit 89471ec6ad65c66e96544d7171f20fa034b7eabd
parent 643d45973cd33b04fa87b164ec2ca9f8242cc8cc
Author: Sebastian Steinhauer <s.steinhauer@yahoo.de>
Date:   Mon, 13 May 2019 09:16:51 +0200

Merge pull request #15 from kieselsteini/develop

cgo 0.5.0
Diffstat:
A.editorconfig | 14++++++++++++++
A.gitignore | 3+++
MLICENSE | 2+-
Mcgo.c | 9+++++----
4 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/.editorconfig b/.editorconfig @@ -0,0 +1,14 @@ +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +indent_style = space +indent_size = 4 + +# Tab indentation (no size specified) +[Makefile] +indent_style = tab diff --git a/.gitignore b/.gitignore @@ -0,0 +1,3 @@ +# ignore build artifacts +*.o +cgo diff --git a/LICENSE b/LICENSE @@ -1,5 +1,5 @@ cgo - a simple terminal based gopher client -Copyright (c) 2014 Sebastian Steinhauer <s.steinhauer@yahoo.de> +Copyright (c) 2019 Sebastian Steinhauer <s.steinhauer@yahoo.de> Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/cgo.c b/cgo.c @@ -1,6 +1,6 @@ /* * cgo - a simple terminal based gopher client - * Copyright (c) 2014 Sebastian Steinhauer <s.steinhauer@yahoo.de> + * Copyright (c) 2019 Sebastian Steinhauer <s.steinhauer@yahoo.de> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -88,7 +88,7 @@ void usage() void banner(FILE *f) { - fputs("cgo 0.4.1 Copyright (c) 2014 Sebastian Steinhauer\n", f); + fputs("cgo 0.5.0 Copyright (c) 2019 Sebastian Steinhauer\n", f); } void parse_config_line(const char *line) @@ -746,11 +746,12 @@ int parse_uri(const char *uri) } else snprintf(parsed_port, sizeof(parsed_port), "%d", 70); /* parse selector */ if (*uri == '/') { - for (i = 0; *uri; uri++) + for (i = 0, ++uri; *uri; ++uri) if (i < sizeof(parsed_selector) - 1) parsed_selector[i++] = *uri; parsed_selector[i++] = *uri; - } else snprintf(parsed_selector, sizeof(parsed_selector), "%s", "/"); + } else snprintf(parsed_selector, sizeof(parsed_selector), "%s", ""); + return 1; }