should strstr return const char* ?

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

 



Hi there,

A couple of queries. I hope could be considered.

I see this function on Ubuntu 9.10:

     char *strstr(const char *haystack, const char *needle);

Should it not return as const char * though?

Also could the description be clarified:

DESCRIPTION
The strstr() function finds the first occurrence of the substring needle in the string haystack. The terminating
       '\0' characters are not compared.


Can this be added: "If needle is longer than haystack it will never match. When the search reaches a character position in haystack which does not leave enough characters left to compare, searching will end, the haystack buffer will not be overrun.

Thanks again for considering this.
Cheers, Jon
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux