Hello Jim,
you are right, snprintf is the preferred way, i did use that too when i was writing a simple custom gzip_http_post method. With original code I just meant, it's know to work code,and not new code introduced by the patch, which may lead to problems in case the patch is applied.
As well i was uncertain if fixing this is going to be appreciated at all, because development efforts seem to go more into NaviServer rather then Aolserver. Hearing that there is still interest i can make the changes, and would appreciated some guidance.
First Question is there a preferred way to set the interp result, as there are 2 ways Tcl_SetResult/Tcl_SetObjResult and Tcl_AppendResult. Currently the result is set to a single string, to replace it by the new API I would go with.
Example Integer:
sprintf(interp->result, "%d", nread);
is replaced by
Tcl_SetObjResult(interp, Tcl_NewIntObj(nread));
Example String(1):
interp->result = "could not register callback";
is replaced by
Tcl_SetResult(interp, "could not register callback", TCL_STATIC);
Example String(2):
sprintf(interp->result, "%s", Tcl_GetChannelName(chan));
is replaced by
Tcl_SetResult(interp, Tcl_GetChannelName(chan), TCL_VOLATILE);
Thanks Bjoern