aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorlamp2023-05-11 22:49:31 +0100
committerlamp2023-05-11 22:49:31 +0100
commitbd81e74b2f59d2bad0ee0b42d1bc4b6d60514532 (patch)
tree6ea9447e3edbc319c77724369ce558334113b477 /main.c
parent14b336eb507c69706aacc55e872824b4fcf8acaa (diff)
remove string "cleaning"main
Diffstat (limited to 'main.c')
-rw-r--r--main.c25
1 files changed, 0 insertions, 25 deletions
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));