Re: scanimage -T using Purify...

From: Oliver Rauch (oliver.rauch@rauch-domain.de)
Date: Tue May 01 2001 - 11:23:01 PDT

  • Next message: Henning Meier-Geinitz: "Re: New backend: UMAX 1220P sane'ification take 1"

    Henning Meier-Geinitz wrote:
    >
    >
    > Ok, if we have a str containing "\n" (empty line), len
    > will be 1 and str[--len] is '\n' and after that len = 0. Next step:
    > len is 0, --len is -1 --> str[-1] !
    >
    > Something like
    >
    > while((len > 0) && (isspace(str[--len])))
    >
    > should fix this. Petter, can you check this with purify?
    >

    if I see it right sanei_config_read() does not change
    the return buffer when the line is "\n".
    This also should be changed (buffer[0]=0).

    > umax.c:
    > len = strlen (config_line);
    > if (config_line[len - 1] == '\n')
    > {
    > config_line[--len] = '\0';
    > }
    >
    > What happens if len==0? Similar things are probably in many backends.
    >

    Ok, this hsould fix it.

    if (len && (config_line[len - 1] == '\n'))

    Bye
    Oliver

    -- 
    Homepage:	http://www.rauch-domain.de
    sane-umax:	http://www.rauch-domain.de/sane-umax
    xsane:		http://www.xsane.org
    E-Mail:		mailto:Oliver.Rauch@rauch-domain.de
    

    -- Source code, list archive, and docs: http://www.mostang.com/sane/ To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com



    This archive was generated by hypermail 2b29 : Tue May 01 2001 - 11:21:38 PDT