[Nut-upsdev] [PATCH 17/36] quote the debug output so one can see how many spaces there are

Arnaud Quette aquette.dev at gmail.com
Mon May 14 09:26:11 UTC 2012


2012/3/9 Greg A. Woods <woods at planix.com>:
> From: "Greg A. Woods" <woods at planix.com>
>
> ---
>  drivers/blazer_ser.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/blazer_ser.c b/drivers/blazer_ser.c
> index 4eb0460..fe65c61 100644
> --- a/drivers/blazer_ser.c
> +++ b/drivers/blazer_ser.c
> @@ -58,7 +58,7 @@ int blazer_command(const char *cmd, char *buf, size_t buflen)
>                return ret;
>        }
>
> -       upsdebugx(3, "send: %.*s", (int)strcspn(cmd, "\r"), cmd);
> +       upsdebugx(3, "send: '%.*s'", (int)strcspn(cmd, "\r"), cmd);
>
>        ret = ser_get_buf(upsfd, buf, buflen, SER_WAIT_SEC, 0);
>
> @@ -67,7 +67,7 @@ int blazer_command(const char *cmd, char *buf, size_t buflen)
>                return ret;
>        }
>
> -       upsdebugx(3, "read: %.*s", (int)strcspn(buf, "\r"), buf);
> +       upsdebugx(3, "read: '%.*s'", (int)strcspn(buf, "\r"), buf);
>        return ret;
>  #else
>        const struct {

applied to trunk, r3583, adding the driver version bump.
thanks.

Note that whenever you change some code in a driver, you should also
bump the driver version!

Arnaud
-- 
Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/



More information about the Nut-upsdev mailing list