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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

CYGWIN-ANNOUNCE UNSUBSCRIBE INFO:
=================================
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@xxxxxxxxxx

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

http://sourceware.org/lists.html#unsubscribe-simple

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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]