[OpenAFS-devel] supporting non /afs root in windows client
Harald Barth
haba@pdc.kth.se
Mon, 04 Nov 2002 16:51:17 +0100 (CET)
> The bug is that
> code = RegQueryValueEx(parmKey, "Mountroot", NULL, NULL,
> cm_mountRoot, &cm_mountRootLen);
>
> will set cm_mountRootLen to be the length of the parameter including null in the
> end of the string (this is how regquery works).
I do not like the strlen(cm_mountRoot) when you actually get
cm_mountRootLen almost right from the call to RegQueryValueEx():
code = RegQueryValueEx(parmKey, "Mountroot", NULL, NULL,
cm_mountRoot, &cm_mountRootLen);
/* Compensate for cm_mountRootLen including trailing NULL */
if (cm_mountRootLen > 0)
cm_mountRootLen--;
Harald.