From ce96b959b74f82979cd5b49543a5e0f780fb3b8f Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 8 Sep 2014 04:45:41 +0200 Subject: [PATCH] Fixed obtaining the baudrate and hardware flow from the configuration file --- src/modems/hayes.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modems/hayes.c b/src/modems/hayes.c index a12e339..0ead178 100644 --- a/src/modems/hayes.c +++ b/src/modems/hayes.c @@ -1937,13 +1937,13 @@ static int _reset_configure(Hayes * hayes, char const * device, int fd) char const * p; /* baud rate */ - if((p = helper->config_get(helper->modem, "baudrate")) == 0 - || strtoul(p, NULL, 10) == 0) + if((p = helper->config_get(helper->modem, "baudrate")) == NULL + || (baudrate = strtoul(p, NULL, 10)) == 0) baudrate = 115200; baudrate = _reset_configure_baudrate(hayes, baudrate); /* hardware flow */ - if((p = helper->config_get(helper->modem, "hwflow")) == 0 - || strtoul(p, NULL, 10) == 0) + if((p = helper->config_get(helper->modem, "hwflow")) == NULL + || (hwflow = strtoul(p, NULL, 10)) != 0) hwflow = 1; if(flock(fd, LOCK_EX | LOCK_NB) != 0) return 1; @@ -2024,7 +2024,7 @@ static unsigned int _reset_configure_baudrate(Hayes * hayes, #endif default: error_set("%u%s%u%s", baudrate, - "Unsupported baudrate (using ", + ": Unsupported baudrate (using ", 115200, ")"); hayes->helper->error(NULL, error_get(), 1); return B115200;