chg: [client] fixed string parsing for source and destination

pull/23/head
Gerard Wagener 2019-01-17 15:22:27 +01:00
parent c879a22cf2
commit b988939a59
1 changed files with 2 additions and 2 deletions

View File

@ -80,14 +80,14 @@ void d4_update_uuid(d4_t* d4)
int d4_check_config(d4_t* d4)
{
// TODO implement other sources, file, fifo, unix_socket ...
if (strlen(d4->conf[SOURCE]) > strlen(STDIN)) {
if (strlen(d4->conf[SOURCE]) >= strlen(STDIN)) {
if (!strncmp(d4->conf[SOURCE],STDIN, strlen(STDIN))) {
d4->source.fd = STDIN_FILENO;
}
}
//TODO implement other destinations file, fifo unix_socket ...
if (strlen(d4->conf[DESTINATION]) > strlen(STDOUT)) {
if (strlen(d4->conf[DESTINATION]) >= strlen(STDOUT)) {
if (!strncmp(d4->conf[DESTINATION],STDOUT, strlen(STDOUT))) {
d4->destination.fd = STDOUT_FILENO;
}