Browse Source

ckpmsg allow comments with a leading '#' and timestamp comments and empty lines

master
kanoi 10 years ago
parent
commit
f7461be43e
  1. 8
      src/ckpmsg.c

8
src/ckpmsg.c

@ -104,13 +104,17 @@ int main(int argc, char **argv)
LOGERR("Failed to get a valid line");
break;
}
mkstamp(stamp, sizeof(stamp));
len = strlen(buf);
if (len < 2) {
LOGERR("No message");
LOGERR("%s No message", stamp);
continue;
}
buf[len - 1] = '\0'; // Strip /n
mkstamp(stamp, sizeof(stamp));
if (buf[0] == '#') {
LOGDEBUG("%s Got comment: %s", stamp, buf);
continue;
}
LOGDEBUG("%s Got message: %s", stamp, buf);
sockd = open_unix_client(socket_dir);

Loading…
Cancel
Save