public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* should strstr    return const char*  ?
@ 2010-02-28 21:29 Jon
       [not found] ` <4B8AE057.7000000-hus3n9K41k0@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Jon @ 2010-02-28 21:29 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-19  5:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-28 21:29 should strstr return const char* ? Jon
     [not found] ` <4B8AE057.7000000-hus3n9K41k0@public.gmane.org>
2010-03-05 20:08   ` Mike Frysinger
2010-06-19  5:49   ` Michael Kerrisk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox