> 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.
_______________________________________________
OpenAFS-devel mailing list
[EMAIL PROTECTED]
https://lists.openafs.org/mailman/listinfo/openafs-devel

Reply via email to