This is the mail archive of the
mailing list for the Cygwin project.
Re: src/winsup/cygwin ChangeLog dcrt0.cc
On 27.01.2012 10:46, VÃclav Zeman wrote:
+#define is_dos_path(s) (isdrive(s) \
+ || ((s) == '\\' \
+ && (s) == '\\' \
+ && isalpha ((s)) \
+ && strchr ((s) + 3, '\\')))
Is it safe to access 2nd, 3rd and 4th characters of the word without
checking the length first?
Yes, if s is a NUL-terminated string. If s != '\0' (because, e.g.,
s == '\\') then s is valid; if s != '\0' then s is valid,
and so on.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple