Hi,

while playing with Pascal Baerten's BAE0911, I found owtcl is treating
all results from OW_get as C strings, which makes reading data with
embedded \0 chars impossible.

I made I minimal patch which uses the length information of OW_get
instead. Works for me. Comments?


cvs diff -u module/owtcl/ow.c
Index: module/owtcl/ow.c
===================================================================
RCS file: /cvsroot/owfs/owfs/module/owtcl/ow.c,v
retrieving revision 1.5
diff -u -r1.5 ow.c
--- module/owtcl/ow.c   23 Sep 2010 03:17:16 -0000      1.5
+++ module/owtcl/ow.c   23 Jun 2013 15:41:39 -0000
@@ -368,7 +368,7 @@
                        resultPtr = Tcl_NewStringObj(buf, -1);
                }
        } else {
-               resultPtr = Tcl_NewStringObj(buf, -1);
+               resultPtr = Tcl_NewStringObj(buf, s);
        }
        Tcl_SetObjResult(interp, resultPtr);
        free(buf);

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

Reply via email to