You found an error, but I think the fix is a few lines up in the
"copy_buffer" routine, where a zero-length string should be a valid return.

Applied. Thanks Jan.


On Sun, Jul 7, 2013 at 4:05 PM, Jan Kandziora <j...@gmx.de> wrote:

> Hello,
>
> I found ascii properties like /simultaneous/single and $chip/alias
> return -EINVAL when the string result is <empty>. I don't think this is
> a useful behaviour as catching this error just for the "empty string"
> case obscures real error cases happening in the layers below.
>
> *This problem is only visible through the language bindings.*
>
>
> Paul, what do you think about returning an empty string in case of an
> empty string, instead of -EINVAL? What could it break? The place where
> the translation happens is line 104 of module/owlib/src/c/ow_get.c.
>
> The following patch seems to work.
>
> Index: ow_get.c
> ===================================================================
> RCS file: /cvsroot/owfs/owfs/module/owlib/src/c/ow_get.c,v
> retrieving revision 1.2
> diff -u -r1.2 ow_get.c
> --- ow_get.c    7 Apr 2010 19:54:24 -0000       1.2
> +++ ow_get.c    7 Jul 2013 19:59:35 -0000
> @@ -101,7 +101,7 @@
>         /* Check the parameters */
>         if (*return_buffer == NULL) {
>                 //  no data.
> -               return -EINVAL;
> +               return 0 ;
>         }
>
>         if ( buffer_length != NULL ) {
>
>
> The log for that file says you made some changes to the return values
> already. The diff between revision 1.0 and 1.1 when that happened,
> however, is not in the CVS archive. Do you remember what you have done
> then?
>
>
> Kind regards
>
>         Jan
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> Owfs-developers mailing list
> Owfs-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to