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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: what the fork is wrong with strtok_r
Date Sat, 28 Mar 2015 17:39:22 -0700
Organization None to speak of
Lines 15
Message-ID <87384omybp.fsf@kst-u.example.com> (permalink)
References <mf6eja$cls$1@reader1.panix.com> <mf6ffi$jqa$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="c77ff4d35e33d1c939d3461ebde8dd0d"; logging-data="32232"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19VY8TDTS6E+kv1y1vjngFS"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:ZW/Hw81JZK2d4uPvJFAk+18IBWg= sha1:KPehSbzbV6yyA48c+tqRrwB26sw=
Xref csiph.com comp.lang.c:59184

Show key headers only | 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