From bd81e74b2f59d2bad0ee0b42d1bc4b6d60514532 Mon Sep 17 00:00:00 2001 From: lamp Date: Thu, 11 May 2023 22:49:31 +0100 Subject: remove string "cleaning" --- main.c | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 543454f..ba784e4 100644 --- a/main.c +++ b/main.c @@ -22,30 +22,6 @@ static void handle_exit(int signal) { logout(ut_line); } -static void clean_string(char *str) { - char *src, *dest; - bool stripped_start = false; - bool should_increment = false; - for (src = dest = str; *src != '\0'; src++) { - *dest = *src; - if (isprint(*dest) && *dest != ' ' && *dest != '\n' && *dest != '\r') { - stripped_start = true; - should_increment = true; - } - if (*dest == ' ' && stripped_start) { - should_increment = true; - } - if (*dest == '\n' || *dest == '\r') { - stripped_start = false; - } - if (should_increment) { - should_increment = false; - dest++; - } - } - *dest = '\0'; -} - int main(int argc, char **argv) { char *name_ptr; int master_fd, slave_fd; @@ -102,7 +78,6 @@ int main(int argc, char **argv) { break; else if (bytes_read > 0) { buffer[sizeof(buffer) - 1] = '\x0'; - clean_string(buffer); notification = notify_notification_new("System Broadcast", buffer, 0); notify_notification_show(notification, NULL); g_object_unref(G_OBJECT(notification)); -- cgit v1.2.3