ignoring \r from firmware when existing
authorChristian Pointner <equinox@realraum.at>
Thu, 10 Sep 2009 08:59:25 +0000 (08:59 +0000)
committerChristian Pointner <equinox@realraum.at>
Thu, 10 Sep 2009 08:59:25 +0000 (08:59 +0000)
door_daemon/door_daemon.c

index 6d43007..0f60c30 100644 (file)
@@ -288,6 +288,9 @@ int process_door(read_buffer_t* buffer, int door_fd, cmd_t **cmd_q, client_t* cl
     if(buffer->buf[buffer->offset] == '\n') {
       buffer->buf[buffer->offset] = 0;
 
+      if(buffer->offset > 0 && buffer->buf[buffer->offset-1] == '\r')
+        buffer->buf[buffer->offset-1] = 0;
+
       log_printf(NOTICE, "door-firmware: %s", buffer->buf);      
 
       int cmd_fd = -1;