Update of /cvsroot/naviserver/naviserver/nsd
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27188/nsd
Modified Files:
tclmisc.c uuencode.c
Log Message:
fixed bug with ns_uuencode and 1 byte string
Index: tclmisc.c
===================================================================
RCS file: /cvsroot/naviserver/naviserver/nsd/tclmisc.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** tclmisc.c 9 Oct 2005 22:27:24 -0000 1.13
--- tclmisc.c 20 Oct 2005 15:03:50 -0000 1.14
***************
*** 455,459 ****
}
string = Tcl_GetStringFromObj(objv[1], &nbytes);
! result = ns_malloc((size_t) 1 + (4 * nbytes) / 2);
Ns_HtuuEncode((unsigned char *) string, (size_t)nbytes, result);
Tcl_SetResult(interp, result, (Tcl_FreeProc *) ns_free);
--- 455,459 ----
}
string = Tcl_GetStringFromObj(objv[1], &nbytes);
! result = ns_malloc((size_t) 1 + (4 * MAX(nbytes,2)) / 2);
Ns_HtuuEncode((unsigned char *) string, (size_t)nbytes, result);
Tcl_SetResult(interp, result, (Tcl_FreeProc *) ns_free);
Index: uuencode.c
===================================================================
RCS file: /cvsroot/naviserver/naviserver/nsd/uuencode.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** uuencode.c 13 Jun 2005 06:14:26 -0000 1.4
--- uuencode.c 20 Oct 2005 15:03:50 -0000 1.5
***************
*** 94,98 ****
* Encoded characters are placed in output which must be
* large enough for the result, i.e., (1 + (len * 4) / 2)
! * bytes.
*
*----------------------------------------------------------------------
--- 94,98 ----
* Encoded characters are placed in output which must be
* large enough for the result, i.e., (1 + (len * 4) / 2)
! * bytes, minimum outout buffer size is 4 bytes.
*
*----------------------------------------------------------------------
|