[libvirt] [PATCH v3 2/8] Qemu arbitrary command-line arguments.

Eric Blake (cygwin) eblake at redhat.com
Fri Jul 2 18:33:31 UTC 2010

On 07/02/2010 09:18 AM, Chris Lalancette wrote:
> +        if (tmp[0] == '\0') {
> +            qemuReportError(VIR_ERR_INTERNAL_ERROR,
> +                            "%s", _("Empty qemu environment name specified"));
> +            goto error;
> +        }
> +        if (strspn(tmp, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_") == 0) {
> +            qemuReportError(VIR_ERR_INTERNAL_ERROR,
> +                            "%s", _("Invalid environment name, it must begin with a letter or underscore"));
> +            goto error;
> +        }

Rather than using strspn here, why not go with a more efficient
c_isdigit()?  For that matter, checking tmp[0]!='\0' can be subsumed by
the c_isdigit(tmp[0]), but then your error messages would have to be merged.

Eric Blake
volunteer cygwin package maintainer

To unsubscribe to the cygwin-announce mailing list, look at the
"List-Unsubscribe: " tag in the email header of this message.  Send email
to the address specified there.  It will be in the format:

cygwin-announce-unsubscribe-YOU=YOURDOMAIN.COM at cygwin.com

If you need more information on unsubscribing, start reading here:


Please read *all* of the information on unsubscribing that is available
starting at this URL.

More information about the libvir-list mailing list