Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #59184

Re: what the fork is wrong with strtok_r

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: what the fork is wrong with strtok_r
Date 2015-03-28 17:39 -0700
Organization None to speak of
Message-ID <87384omybp.fsf@kst-u.example.com> (permalink)
References <mf6eja$cls$1@reader1.panix.com> <mf6ffi$jqa$1@dont-email.me>

Show all headers | View raw


James Kuyper <jameskuyper@verizon.net> writes:
[...]
> Note: if you're using gets() to read the text string, '\n' characters
> will be replaced with '\0', which would make tokenizing on '\n' a little
> difficult. If that fact is completely irrelevant to your problem, that
> demonstrates the need for item 1.

If you're using gets(), that's your first problem.  gets() is inherently
unsafe, and has been removed from the language as of the 2011 standard.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

what the fork is wrong with strtok_r what <ceo@iran.gov> - 2015-03-28 14:41 +0000
  Re: what the fork is wrong with strtok_r James Kuyper <jameskuyper@verizon.net> - 2015-03-28 10:57 -0400
    Re: what the fork is wrong with strtok_r Keith Thompson <kst-u@mib.org> - 2015-03-28 17:39 -0700
      Re: what the fork is wrong with strtok_r James Kuyper <jameskuyper@verizon.net> - 2015-03-28 21:33 -0400
      Re: what the fork is wrong with strtok_r ruben safir <ruben@mrbrklyn.com> - 2015-03-29 03:36 -0400
      Re: what the fork is wrong with strtok_r ruben safir <ruben@mrbrklyn.com> - 2015-03-29 03:39 -0400
  Re: what the fork is wrong with strtok_r Lőrinczy Zsigmond <nospam@for.me> - 2015-03-29 08:28 +0200

csiph-web