mirror of
https://github.com/javalsai/lidm.git
synced 2025-09-05 04:28:00 +02:00
misc batch of fixes before v1.2.3 (#65)
* fix some formatter and linter issues * make clang-tidy/clang-format fail with error status and output in github error format * docs, add kmscon thing * and some CI stuff
This commit is contained in:
4
src/ui.c
4
src/ui.c
@@ -115,13 +115,13 @@ char* trunc_gethostname(const size_t MAXLEN, const char* const ELLIPSIS) {
|
||||
char* buf = malloc(alloc_size);
|
||||
if (!buf) return NULL;
|
||||
|
||||
if(gethostname(buf, alloc_size) != 0) {
|
||||
if (gethostname(buf, alloc_size) != 0) {
|
||||
free(buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (utf8len(buf) > MAXLEN) {
|
||||
int end = utf8trunc(buf, MAXLEN - utf8len(ELLIPSIS));
|
||||
size_t end = utf8trunc(buf, MAXLEN - utf8len(ELLIPSIS));
|
||||
strcpy(&buf[end], ELLIPSIS);
|
||||
}
|
||||
return buf;
|
||||
|
Reference in New Issue
Block a user