Deutsch English Français Italiano |
<votaag$n41b$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com> Newsgroups: comp.lang.c Subject: Re: Buffer contents well-defined after fgets() reaches EOF ? Date: Sun, 16 Feb 2025 19:21:02 +0100 Organization: A noiseless patient Spider Lines: 21 Message-ID: <votaag$n41b$1@dont-email.me> References: <vo9g74$fu8u$1@dont-email.me> <vo9hlo$g0to$1@dont-email.me> <vo9khf$ggd4$1@dont-email.me> <vobf3h$sefh$2@dont-email.me> <vobjdt$t5ka$1@dont-email.me> <vobkd5$t7np$1@dont-email.me> <20250210124911.00006b31@yahoo.com> <86ldu9zxkb.fsf@linuxsc.com> <20250214165108.00002984@yahoo.com> <20250214085627.815@kylheku.com> <voo6sc$3k640$1@dont-email.me> <20250215192911.0000793d@yahoo.com> <20250215225202.179@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Sun, 16 Feb 2025 19:21:04 +0100 (CET) Injection-Info: dont-email.me; posting-host="aaf6e5d3524c9b1f9a0562d9d6447128"; logging-data="757803"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+KZu+N9errLwhz++ybXzt3" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:v3glMuqKS2DQxHuvOO2pOiXT4oo= In-Reply-To: <20250215225202.179@kylheku.com> Bytes: 2095 On 16.02.2025 08:32, Kaz Kylheku wrote: > > I would recommend learning about strspn and strcspn, and writing > your own tokenizing loop: Incidentally, in a recent toy project, I used it for parsing simple syntax. For the code of this thread the strtok() was simpler to use, though. > > The strok function is ill-suited to many situations. For instance, > there are situations in which you do want empty tokens, like CSV, such > that ",abc,def," shows four tokens, two of them empty. Sure. (Always use an appropriate solution for any given task.) Janis > [...]