C scanf()

10 views
Skip to first unread message

T. Ment

unread,
Feb 28, 2019, 11:43:20 AM2/28/19
to
This is a footnote to the pamo.c source code I posted earlier:

Some people think C scanf() is unsafe. The Borland C++ 3.1 help says:

> WARNING: scanf often leads to unexpected results if you diverge from an
> expected pattern. You must teach scanf how to synchronize at the end of a
> line.

But they don't show how to "synchronize at the end of a line," and leave
readers with the notion that scanf() is unsafe.

But it's a powerful tool when used carefully. The pamo.c source code can
"synchronize at the end of a line" to skip over annotations.

If you need to make an annotation that looks like patch data, any extra
non whitespace character on the same line as the patch data will convert
it to an annotation.

The pamo.c scanf() formats have the secret. May require some study.


T. Ment

unread,
Feb 28, 2019, 5:08:00 PM2/28/19
to
On Thu, 28 Feb 2019 16:43:20 +0000, T. Ment wrote:

> pamo.c source code can "synchronize at the end of a line"
> the c scanf() formats have the secret

One secret is understanding how scanf() treats newlines. You might think
it would "start over" after a newline.

But that's not how it works. A newline is not special, it's just another
whitespace to scanf().

Say you have five columns of numbers, and one line is missing a value,
having only four. After the fourth value, scanf() gobbles up the newline
as regular whitespace, taking its fifth value from the first one on the
next line. From then on, everything is out of sync.

To avoid such problems, you must devise "synchronized" format strings to
force scanf() to treat newlines specially, like pamo.c does.


R.Wieser

unread,
Mar 1, 2019, 4:10:50 AM3/1/19
to
T. Ment,

> Some people think C scanf() is unsafe. The Borland C++ 3.1 help says:
>
>> WARNING: scanf often leads to unexpected results if you diverge from
>> an expected pattern. You must teach scanf how to synchronize at the end
>> of a line.
>
> But they don't show how to "synchronize at the end of a line," and leave
> readers with the notion that scanf() is unsafe.

You seem to have fallen into that "expected pattern" trap. :-)

Just imagine its trying to match more than that the line is long. Yep, it
will ignore the line end and continue onto the next one - because it did not
see the "but not further than the end of line" part yet.

Regards,
Rudy Wieser


Steve Nickolas

unread,
Mar 1, 2019, 8:22:57 AM3/1/19
to
My approach to using scanf()...Don't. Use fgets() and sscanf().

-uso.

T. Ment

unread,
Mar 1, 2019, 11:25:35 AM3/1/19
to
On Fri, 1 Mar 2019 08:22:55 -0500, Steve Nickolas <usot...@buric.co>
wrote:

>My approach to using scanf()...Don't. Use fgets() and sscanf().

In the scanf() help, Borland C++ 3.1 has similar advice:


> The combination of gets or fgets followed by sscanf is safe and easy, and
> therefore recommended over scanf.

But like an old wives tale, it misinforms. There are safe ways to use
scanf().

With fgets() fixed buffer length, a long line with trailing whitespace
is a problem. You must either ignore it, or write special code to see if
there's something else out there besides whitespace.

With the right format string, scanf() does that automatically. It can be
done, I showed how.

I don't need to change your mind, I only want to present an alternate
view of scanf(). Even the technical elite have old wives tales. I don't
believe all of them.

R.Wieser

unread,
Mar 1, 2019, 11:39:13 AM3/1/19
to
T. Ment,

> I only want to present an alternate view of scanf()

All you do is /claim/ that its possible, without offering anything to
support it. Whats stoping you ?

Regards,
Rudy Wieser


src153

unread,
Mar 1, 2019, 1:08:36 PM3/1/19
to
On Fri, 1 Mar 2019 17:39:01 +0100, "R.Wieser" <add...@not.available>
wrote:

>> I only want to present an alternate view of scanf()

>All you do is /claim/ that its possible, without offering anything to
>support it.

False statement.


> Whats stoping you ?

What stops Usenet trolls from reading. Who knows. Into the killfile you
go.



src153

unread,
Mar 1, 2019, 1:22:21 PM3/1/19
to
>> All you do is /claim/

> What stops Usenet trolls from reading. Who knows. Into the killfile you
> go.

Oh wait, maybe that's too hard to understand. Let me help you:

/What/ /stops/ /Usenet/ /trolls/ /from/ /reading/

/Who/ /knows/

/Into/ /the/ /killfile/ /you/ /go/



Ross Ridge

unread,
Mar 1, 2019, 2:05:00 PM3/1/19
to
src153 <src...@protocol.invalid> wrote:
> Into the killfile you go.

Please add me to your killfile too. Thanks.

--
l/ // Ross Ridge -- The Great HTMU
[oo][oo] rri...@csclub.uwaterloo.ca
-()-/()/ http://www.csclub.uwaterloo.ca/~rridge/
db //

src153

unread,
Mar 1, 2019, 2:15:43 PM3/1/19
to
On Fri, 1 Mar 2019 19:04:58 +0000 (UTC), rri...@csclub.uwaterloo.ca
(Ross Ridge) wrote:

> Please add me to your killfile too. Thanks.

Do you have a dispute with the subject material? Or do you just like to
associate with trolls?


Ross Ridge

unread,
Mar 1, 2019, 2:20:24 PM3/1/19
to
rri...@csclub.uwaterloo.ca (Ross Ridge) wrote:
> Please add me to your killfile too. Thanks.

src153 <src...@protocol.invalid> wrote:
>Do you have a dispute with the subject material? Or do you just like to
>associate with trolls?

I would just like to be added to your killfile as well. Thanks.

src153

unread,
Mar 1, 2019, 2:31:48 PM3/1/19
to
On Fri, 1 Mar 2019 19:20:21 +0000 (UTC), rri...@csclub.uwaterloo.ca
(Ross Ridge) wrote:

>> Do you have a dispute with the subject material? Or do you just like to
>> associate with trolls?

> I would just like to be added to your killfile as well. Thanks.

When it suits me, not you.


R.Wieser

unread,
Mar 1, 2019, 3:16:08 PM3/1/19
to
src153,

> False statement.

I see you do not try to support your position either. Whats stopping /you/
?

Regards,
Rudy Wieser


Ross Ridge

unread,
Mar 1, 2019, 4:29:51 PM3/1/19
to
src153 <src...@protocol.invalid> wrote:
> Do you have a dispute with the subject material? Or do you just like to
> associate with trolls?

rri...@csclub.uwaterloo.ca (Ross Ridge) wrote:
> I would just like to be added to your killfile as well. Thanks.

src153 <src...@protocol.invalid> wrote:
>When it suits me, not you.

Oh, ok. You were kind enough to put R.Wieser in your killfile without
him even asking, so I thought it wouldn't be too much of a bother for
you to add me as well.

src153

unread,
Mar 1, 2019, 4:53:07 PM3/1/19
to
On Fri, 1 Mar 2019 21:29:48 +0000 (UTC), rri...@csclub.uwaterloo.ca
(Ross Ridge) wrote:

>Oh, ok. You were kind enough to put R.Wieser in your killfile without
>him even asking, so I thought it wouldn't be too much of a bother for
>you to add me as well.

Can't let it go? Got to have the last word?

Let me guess:

Liberal? Abortion supporter? Evolution believer? 2 out of 3?


Rod Pemberton

unread,
Mar 1, 2019, 4:55:55 PM3/1/19
to
On Fri, 1 Mar 2019 17:39:01 +0100
"R.Wieser" <add...@not.available> wrote:

> > I only want to present an alternate view of scanf()
>
> All you do is /claim/ that its possible, without offering anything to
> support it. Whats stoping you ?
>

He mentioned pamo.c in the first post in this thread, but he didn't
post it in this thread.

He posted pamo.c in "PC-MOS 2012 date bug fix" thread:

https://groups.google.com/d/msg/comp.os.msdos.programmer/_sIrf_P3k2c/MMiD6tzPBwAJ

In pamo.c, he's using this format string for scanf():

char fmt[] = "%lx: %x %x%*[ \t]%1[^\n]";

It appears to conform to ANSI C.

In it he uses the [ conversion, along with field width specifications,
which allows him to specify specific characters to search for,
specifically any quantity of spaces and tabs, and then one or more
characters except a newline.

This is probably far easier than using strtok(). However, portability
and compliance of string format specifications can be questionable,
especially so for low use formats such as this one.

As for whether it does what he claims, IDK. I've serious issues with
ANSI C compliant format strings working correctly with different
compilers and for different environments. I.e., it might or it might
not, even if correct C code.


Rod Pemberton
--
Apple opposes "glorifying violence" and "dehumanizing language". Yet,
it manufactures products in China which commits crimes against humanity.

Rod Pemberton

unread,
Mar 1, 2019, 4:56:03 PM3/1/19
to
On Fri, 01 Mar 2019 19:31:47 +0000
src153 <src...@protocol.invalid> wrote:

> On Fri, 1 Mar 2019 19:20:21 +0000 (UTC), rri...@csclub.uwaterloo.ca

> > I would just like to be added to your killfile as well. Thanks.
>
> When it suits me, not you.
>

Ross and Rudy have both been around here for a long time.

They may be prickly, but they're not trolls. IRC, at one point, they
were both going to put each other in their own killfiles.

As you noted, not many people are here. So, you may wish to apologize
if you want someone to talk to ...

Ross Ridge

unread,
Mar 1, 2019, 5:20:45 PM3/1/19
to
src153 <src...@protocol.invalid> wrote:
>Can't let it go? Got to have the last word?

I don't think that's going to be possible, but let's see.

>Let me guess:
>
>Liberal? Abortion supporter? Evolution believer? 2 out of 3?

I doubt anything I could say or do would convince you that it's not
all three.

T. Ment

unread,
Mar 1, 2019, 5:30:59 PM3/1/19
to
On Fri, 1 Mar 2019 16:58:29 -0500, Rod Pemberton <inv...@lkntrgzxc.com>
wrote:

> This is probably far easier than using strtok().

Right. Easy is the point. Thanks for reading enough to get it.


> As for whether it does what he claims, IDK.

It works on my data. If anyone can produce a test case that fails, I'll
see about fixing it.


> I've serious issues with ANSI C compliant format strings working
> correctly with different compilers and for different environments.

As noted with the pamo.c source code, I used Borland C++ 3.1. If someone
wants to test other DOS C compilers and post results, go for it


src153

unread,
Mar 1, 2019, 5:39:30 PM3/1/19
to
On Fri, 1 Mar 2019 16:58:37 -0500, Rod Pemberton <inv...@lkntrgzxc.com>
wrote:

> As you noted, not many people are here. So, you may wish to apologize
> if you want someone to talk to ...

Rod, you read the material and understood it. If other people are too
lazy to bother, I will not spend my time reading it aloud to them like
children.


Ross Ridge

unread,
Mar 1, 2019, 5:46:41 PM3/1/19
to
Rod Pemberton <inv...@lkntrgzxc.com> wrote:
>They may be prickly, but they're not trolls. IRC, at one point, they
>were both going to put each other in their own killfiles.

I don't recall anyone threatening to put me in their killfile here.
I also haven't put anyone in my killfile in over 20 years, so I think
you may be thinking of someone else.

And to be honest, I am trolling the name changing guy. While I do really
want him to put me in his killfile, I am of course also mocking him.
I always find it absurd when people think it's some sort of punishment.

src153

unread,
Mar 1, 2019, 5:48:46 PM3/1/19
to
On Fri, 1 Mar 2019 22:20:41 +0000 (UTC), rri...@csclub.uwaterloo.ca
(Ross Ridge) wrote:

>> Liberal? Abortion supporter? Evolution believer? 2 out of 3?

> I doubt anything I could say or do would convince you that it's not
> all three.

Jesus said if they don't believe Moses, they won't believe miracles
either. So if you don't believe Moses, you get none.


src153

unread,
Mar 1, 2019, 5:55:47 PM3/1/19
to
On Fri, 1 Mar 2019 22:46:38 +0000 (UTC), rri...@csclub.uwaterloo.ca
(Ross Ridge) wrote:

> killfile ... I always find it absurd when people think it's some
> sort of punishment.

No, you don't understand. My killfile gets rid of pests who try to waste
my time. There is no need to punish the dead.


Ross Ridge

unread,
Mar 1, 2019, 6:35:01 PM3/1/19
to
src153 <src...@protocol.invalid> wrote:
>Jesus said if they don't believe Moses, they won't believe miracles
>either. So if you don't believe Moses, you get none.

You're saying you're Moses?

src153

unread,
Mar 1, 2019, 6:41:29 PM3/1/19
to
On Fri, 1 Mar 2019 23:34:58 +0000 (UTC), rri...@csclub.uwaterloo.ca
(Ross Ridge) wrote:

> You're saying you're Moses?

No I'm just saying what Jesus said. But you don't believe, do you?


Ross Ridge

unread,
Mar 1, 2019, 7:09:03 PM3/1/19
to
rri...@csclub.uwaterloo.ca (Ross Ridge) wrote:>
> You're saying you're Moses?

src153 <src...@protocol.invalid> wrote:
>No I'm just saying what Jesus said. But you don't believe, do you?

No, I don't believe you're Moses.

src153

unread,
Mar 1, 2019, 7:14:58 PM3/1/19
to
On Sat, 2 Mar 2019 00:09:00 +0000 (UTC), rri...@csclub.uwaterloo.ca
(Ross Ridge) wrote:

>> No I'm just saying what Jesus said. But you don't believe, do you?

> No, I don't believe you're Moses.

You're good at missing the point, as atheists often do.


Ross Ridge

unread,
Mar 1, 2019, 7:19:49 PM3/1/19
to
src153 <src...@protocol.invalid> wrote:
>You're good at missing the point, as atheists often do.

I have a different point to make here. Let's see how it goes.

src153

unread,
Mar 1, 2019, 7:32:16 PM3/1/19
to
On Sat, 2 Mar 2019 00:19:46 +0000 (UTC), rri...@csclub.uwaterloo.ca
(Ross Ridge) wrote:

> I have a different point to make here. Let's see how it goes.

No, you don't have a point. You started a fight not your own, and you
don't know when to quit. I won't trouble the good people here by beating
you silly, so take it to another group if you enjoy it.


Ross Ridge

unread,
Mar 1, 2019, 7:44:25 PM3/1/19
to
rri...@csclub.uwaterloo.ca (Ross Ridge) wrote:
> I have a different point to make here. Let's see how it goes.

src153 <src...@protocol.invalid> wrote:
>No, you don't have a point. You started a fight not your own, and you
>don't know when to quit. I won't trouble the good people here by beating
>you silly, so take it to another group if you enjoy it.

Sorry, I wouldn't be able to make my point if I did that.

Rod Pemberton

unread,
Mar 1, 2019, 9:07:46 PM3/1/19
to
a) Yes, but you can't assume the guys here are C programmers either.

They might be, or they might be x86 assembly guys, which is more likely
IMO in regards to the varieties of DOS. Or, they could have experience
with both like me. Of course, you might see a Pascal/Delphi guy every
now and again too. (If anyone here is under age 35, maybe even 45,
they've probably never done any C or x86 assembly programming, i.e., all
internet/website or mobile/smartphone programming.)


b) As for C compilers, very few use Turbo C or Borland C anymore.

I've usually seen Turbo C and Borland C used for 16-bit C code, but
OpenWatcom can do that too. I think these are the most common
(non-commercial). Gnu GCC via Linux, DJGPP, MinGW, or Cygwin. LCC via
LCC-Win32 or Pelles C. OpenWatcom. LLVM. etc.

Personally, I'm using DJGPP (GCC) and OpenWatcom for home use on
MS-DOS, and GCC on Linux. I've been considering checking out a newer
version of OpenWatcom for Linux, i.e., speed as my computer is aging.

Occasionally, someone will use (Bruce's) BCC or Ladsoft. There are some
others like SmallerC or Small C or TCC etc that aren't frequently used.

https://gcc.gnu.org/
http://www.delorie.com/djgpp/
http://www.mingw.org/
https://www.cygwin.com/
https://lcc-win32.services.net/
https://www.pellesc.de/
http://openwatcom.org/
https://llvm.org/
http://ladsoft.tripod.com/

R.Wieser

unread,
Mar 2, 2019, 3:29:30 AM3/2/19
to
Rod,

> He mentioned pamo.c in the first post in this thread

I found it that (in his "PC-MOS 2012 date bug fix" thread), and checked it
out. I did not see anything in it to support his stance though.

And by the way: Don't bother posting "google groups" references. I've
disabled javascript, and I'm not prepared to enable it for stuff like that
(read: at all).

Funny though: When you google for stuff and you get a "google groups" hit
back not even their own "cache" result can make anything out of it (left
hand (don't) meet right hand). :-)

> In pamo.c, he's using this format string for scanf():
>
> char fmt[] = "%lx: %x %x%*[ \t]%1[^\n]";

Yep. With no checks of if the line ends after the ":" or second number.
In short, falling for that "expected pattern". :-)

And for the record: that format string can't be what the OP was referring
to: no "synchronize at the end of a line" (sic) in sight anywhere. That he
does, for some reason, seperatily.

Regards,
Rudy Wieser


R.Wieser

unread,
Mar 2, 2019, 3:40:06 AM3/2/19
to
src153,

> Jesus said if they don't believe Moses, they won't believe
> miracles either. So if you don't believe Moses, you get none.

Thats is what people with an religious agenda always try to turn it into.
The other way to read it is that you still get them (jesus was never picky
about who he helped) but you will not recognise them as such.

... or they are not miracles at all to begin with, but the religious people
with an agenda would like you to believe they are. :-)

Regards,
Rudy Wieser


R.Wieser

unread,
Mar 2, 2019, 3:55:52 AM3/2/19
to
src153,

> No I'm just saying what Jesus said.

No, he didn't. And the bible says that there is a special place in hell for
people who (ab)use his, or his fathers name for their own good.

... But I guess you either skipped that part or are ignoring it for some
reason. Your day will come my lad. When you discover that your "stairway
into heaven" turns out to be a "ladder into hell". I suggest you make
amends before that point. jesus may be forgiving, but god sure isn't.

Regards,
Rudy Wieser


src153

unread,
Mar 2, 2019, 10:55:00 AM3/2/19
to
On Sat, 2 Mar 2019 09:55:47 +0100, "R.Wieser" <add...@not.available>
wrote:

> I found it that (in his "PC-MOS 2012 date bug fix" thread), and checked it
> out. I did not see anything in it to support his stance though.

Rod understood it. But you still don't, even after he held your hand and
guided you to it.

When you can't add anything useful to the subject material, and can't
keep your mouth shut, you're a troll. Seniority doesn't make you less of
one.


>> I'm just saying what Jesus said.

> No, he didn't.

Yes he did. Luke 16:31.


> you discover that your "stairway into heaven" turns out to be a
> "ladder into hell". I suggest you make amends before that point.

Atheists can't understand the Bible because they start with a false
premise. I don't know your final destination, but you're still headed to
my killfile.


src153

unread,
Mar 2, 2019, 11:10:11 AM3/2/19
to
On Sat, 2 Mar 2019 09:29:22 +0100, "R.Wieser" <add...@not.available>
wrote:

>> char fmt[] = "%lx: %x %x%*[ \t]%1[^\n]";

>Yep. With no checks of if the line ends after the ":" or second number.
>In short, falling for that "expected pattern". :-)

In that case, the line is an annotation and bypassed. The patch data
criteria is not met.


>And for the record: that format string can't be what the OP was referring
>to: no "synchronize at the end of a line" (sic) in sight anywhere. That he
>does, for some reason, seperatily.

Why prove that you don't understand what you're reading?


R.Wieser

unread,
Mar 2, 2019, 1:43:08 PM3/2/19
to
src153,

> Yes he did. Luke 16:31.
...
>>> So if you don't believe Moses, you get none.

Do tell me where I can get that weed you're smoking. :-)

> Atheists can't understand the Bible

Having a bit of an agenda there, hmm ?

Newsflash: Most all religous people only /think/ that they know, and than
come together to praise each other about how well the other agrees with what
they agree with themselves.

Also: no, being able to regurgitate words does not constitute to
understanding them. If that where true than idiot-savants (or people with
an eiditic memory) would be geniuses.

Next problem: Which iteration of the bible have you read (1) ? And for
that matter which branch-version of it ? There are quite a number of
branches which all call themselves christians (2).

(1) Most people, probably like you, are content with a translation that has
gone thru a /lot/ of rewrites. And FYI, whoe chapters have been removed
over time, because the thanwhile pope thought the stories did not match
their projection of jesus being a fully non-violent person.

... but for that one time he got angry. But that again, that was just
righteous indignation about how the place of worship of his father was used
my merchants to sell stuff.

(2) and all of them claim to have /the only/ correct interpretation of the
bible. Funny that.

And for the record: define "atheists". Just a friendly warning though: If
it contains "not exactly believing what I believe" than you're /again/ make
a mockery of jesus teachings.

> I don't know your final destination, but you're still headed to
> my killfile.

Yeah, about that ... You have no problem with "alternative truths", do you
? In your first reply you told me you already put me there, confirmed with
a second "easy reader" post. But here you are, talking to me. How's that
possible ?

Regards,
Rudy Wieser

P.s.
Did you know that the different christian branches do not even have those 10
commandments in the same order, of even have exactly 10 ? They all must be
heathens, don't you think ? :-)

P.p.s
When is the last time you stoned someone to death, christian or not, because
he didn't follow the rules as layed out in the bible ? 'Cause that rule
also in there (though, maybe not in your much later version of it).

You have never done that ? Because you let /human/ Law trump the /Bible/ ?
Seriously ? You are not really a believer, are you ...


R.Wieser

unread,
Mar 2, 2019, 1:54:41 PM3/2/19
to
src153,

> In that case, the line is an annotation and bypassed.

False statement. (to use your own "informative" style)

> The patch data criteria is not met.

You have all the info (code as well as the description to the function) at
your fingertips, and have not even /tried/ it ? How dumb can you be ...

> Why prove that you don't understand what you're reading?

Lolz ! Prove me wrong in the above, I dare you.

Most likely you will, after having done the test, /never/ speak of this
again, and try to burry it as if it was never said by you in the first
place. Probably by launching some personal attack. 3.... 2.... 1....

Regards,
Rudy Wieser


Ross Ridge

unread,
Mar 2, 2019, 1:58:38 PM3/2/19
to
src153 <src...@protocol.invalid> wrote:
> Atheists can't understand the Bible

R.Wieser <add...@not.available> wrote:
> Having a bit of an agenda there, hmm ?

So he was lying then when he said he put you in his killfile...

src153

unread,
Mar 2, 2019, 2:06:47 PM3/2/19
to
On Sat, 2 Mar 2019 19:43:04 +0100, "R.Wieser" <add...@not.available>
wrote:

>> I don't know your final destination, but you're still headed to
>> my killfile.

> In your first reply you told me you already put me there

I said into the killfile you go. I didn't say when. I won't further
litter this NG arguing with atheists, I just wondered what mindset I'm
dealing with. To continue down that path, take it to another group.

If you had anything useful to say about the subject material, it would
be apparent by now. What I see is, you don't understand it. And it's not
my job to educate you.

If you can prove the code wrong with a test case, do it, and post the
results. But that takes work, and you're all talk.


src153

unread,
Mar 2, 2019, 2:12:11 PM3/2/19
to
On Sat, 2 Mar 2019 19:54:37 +0100, "R.Wieser" <add...@not.available>
wrote:

>> In that case, the line is an annotation and bypassed.

>False statement. (to use your own "informative" style)

>> The patch data criteria is not met.

>You have all the info (code as well as the description to the function) at
>your fingertips, and have not even /tried/ it ? How dumb can you be ...

You blather on with false accusations, but you can't produce one test
case of failure.

Classic troll.


Sjouke Burry

unread,
Mar 2, 2019, 2:12:52 PM3/2/19
to
It is their reason against your stupidity.

R.Wieser

unread,
Mar 2, 2019, 2:16:28 PM3/2/19
to
Ross,

>> Having a bit of an agenda there, hmm ?
>
> So he was lying then when he said he put you in his killfile...

Ross ! You don't say that about a christian and god-fearing person like
him. I'm sure he can explain himself. Probably by quoting something outof
the bible.

Oh wait ... Nope, I don't think he can. :-)

Regards
Rudy Wieser


R.Wieser

unread,
Mar 2, 2019, 2:23:15 PM3/2/19
to
src153,

> I said into the killfile you go. I didn't say when.

:-) You're not even outwitting a 10 year old there. /Soooo/ transparent.

> I won't further litter this NG arguing with atheists

Good. Religion and politics have no place here.

> What I see is, you don't understand it.

All what you see is what you /want/ to see. And even though you have
already worked with the very issue I've referred to you /still/ do not
understand it.

> If you can prove the code wrong with a test case,

Pick any of your patch files. Break a line after the colon and/or after the
second value. Moron.

Regards,
Rudy Wieser


src153

unread,
Mar 2, 2019, 2:23:32 PM3/2/19
to
On Sat, 02 Mar 2019 20:12:40 +0100, Sjouke Burry
<burrynu...@ppllaanneett.nnll> wrote:

> It is their reason against your stupidity.

Are you joining the atheist tag team? All you pseudo intellectuals need
is one test case of failure.

Where is it?


src153

unread,
Mar 2, 2019, 2:53:57 PM3/2/19
to
On Sat, 2 Mar 2019 20:23:11 +0100, "R.Wieser" <add...@not.available>
wrote:

> Pick any of your patch files. Break a line after the colon and/or after the
> second value.

The code still works. But the two lines do not become annotations as I
thought.


> Moron.

Thanks for the help friend. Took you long enough to get around to it.


Sjouke Burry

unread,
Mar 2, 2019, 3:39:23 PM3/2/19
to
Trying to fight superstition with reason.

R.Wieser

unread,
Mar 2, 2019, 3:50:50 PM3/2/19
to
src153,

> The code still works.

Yes. And thats exactly the problem.

> But the two lines do not become annotations as I thought.

Have you already figured it out why ? Stupid, aint it ? Of you I mean.
So simple, and even with everything infront of you *and* with it having been
pointed out to you by me a few times you failed to spot it.

> Thanks for the help friend.

Someone who wields his religion as a shield so he doesn't have to reason or
explain will /never/ be a friend of mine, regardles of which god he claims
to worship. And yes, /claim/, as you are not, in any way, living according
to jesus guidings. Far from it actually. You're nothing more than, what
we call here, a "mouth christian" - All talk, but no conviction. None.

> Took you long enough to get around to it.

If I wouldn't have told it you would most likely /never/ have found it on
your own.


And I'm afraid that you have thrown away all credit you might have had here.
Stupid enough to refuse to listen /or/ test - even when *you got the problem
on a silver platter* - and using religion as a justifies-all weapon/shield.
And ofcourse some fast talk to explain you failing even your own blacklist
promiss.

Face it kiddo, you blew it good. Not that I have a problem with that,
mind you. :-)

Regards,
Rudy Wieser


src153

unread,
Mar 2, 2019, 4:19:32 PM3/2/19
to
On Sat, 2 Mar 2019 21:50:45 +0100, "R.Wieser" <add...@not.available>
wrote:

> you have thrown away all credit

That's a lot of venom for one technical error.


>> But the two lines do not become annotations as I thought.
> Have you already figured it out why?

It's eating the newline as whitespace. I thought the format string would
prevent that. I'll look at it.


R.Wieser

unread,
Mar 2, 2019, 4:46:05 PM3/2/19
to
src153,

> That's a lot of venom for one technical error.

:-) keep believing that kiddo. Just deny everything else having ever
happened. It suits you.

> It's eating the newline as whitespace. I thought the format string
> would prevent that.

You MORON. Your own formatting makes use of it: you /specifically/ went for
a "%*[ \t]" construction so you /wouldn't/ skip a newline there. And now
you claim not to have known ? How dense can you be ...

Next time maybe try to actually /test/ what you wrote, and not just believe
that it will work. This is science kiddo, not some religion. Keep the
non-questioning deferrence for your church - or whatever you call your place
of worship.

Than again, hearing you here there is a good chance you just copy-pasted
that from somewhere, without really knowing what it does - and not caring
either.

Kiddo, have a nice, long life. Goodbye.


Rod Pemberton

unread,
Mar 2, 2019, 5:03:26 PM3/2/19
to
On Sat, 02 Mar 2019 15:54:59 +0000
src153 <src...@protocol.invalid> wrote:


<OT religion, yet again, on yet another newsgroup ...>

> > you discover that your "stairway into heaven" turns out to be a
> > "ladder into hell". I suggest you make amends before that point.
>
> Atheists can't understand the Bible because they start with a false
> premise. I don't know your final destination,
>

FYI, I'm non-religious. I avoid the terms athiest and agnostic, as the
terms are biased, i.e., defined from a religious perspective.

It may be harder to be a programmer when religious, as truth and logic
are so important to the task.

I don't hold anything against the religious, with one exception, as
most of my friends and family are. However, they claim that the Bible
is the word of God, usually absolute, yet they cherry-pick what they
want to believe from within it and twist what was said to fit their
Christian beliefs.

For example, you most likely believe you'll get into Heaven simply
because you accepted Jesus Christ as your savior, but that isn't what
the Bible actually says. You only get to visit the Father for doing so:

John 14:6 KJV

And, I know your final destination isn't in Heaven, at least according
to Christianity:

Luke 20:35 KJV
Revelations 7:3-4 KJV
Revelations 14:1-4 KJV

I doubt that you - or just about anyone who has ever lived on the planet
Earth - meet all the requirements to make it into Heaven as in versus
cited above:

males not defiled by women, virgins
unmarried and not betrothed
only 144,000 make it into Heaven
name of the Father on their foreheads
children of Israel

Now, just what would a male "God and the Lamb" want with "the
firstfruits" ... (Revelations 14:4)

You can check those verses for various Bible versions here:
https://www.biblegateway.com/

If you want to learn about the more bizarre and disgusting aspects of
Christianity, this is a good place to start:

https://www.nobeliefs.com/DarkBible/DarkBibleContents.htm

Rod Pemberton

unread,
Mar 2, 2019, 5:04:59 PM3/2/19
to
On Sat, 2 Mar 2019 09:55:47 +0100
"R.Wieser" <add...@not.available> wrote:

> When you discover that your
> "stairway into heaven" turns out to be a "ladder into hell".

Eh, what Hell? "As above, so below" is what some say ... So,
apparently, there are two Heavens. Ever heard a Satanist say the
Lord's Prayer? Me neither, but it would clearly have the same words
but with different meanings.

"Yes, there are two paths you can go by, but in the long run, there's
still time to change the road you're on." ... "And, she's buying a
stairway to Heaven. There's a sign on the wall, but she wants to be
sure, 'cause you know sometimes words have two meanings."

Um, how did we get onto "Stairway to Heaven" by Led Zeppelin? This is
what happens when you guys start talking about religion.

src153

unread,
Mar 2, 2019, 5:09:10 PM3/2/19
to
On Sat, 2 Mar 2019 22:46:00 +0100, "R.Wieser" <add...@not.available>
wrote:

>You MORON. Your own formatting makes use of it: you /specifically/ went for
>a "%*[ \t]" construction so you /wouldn't/ skip a newline there. And now
>you claim not to have known ? How dense can you be ...

You done with your victory dance yet?

I got some information from this. What did you get?


src153

unread,
Mar 2, 2019, 5:43:07 PM3/2/19
to
On Sat, 2 Mar 2019 17:05:59 -0500, Rod Pemberton <inv...@lkntrgzxc.com>
wrote:

> If you want to learn about the more bizarre and disgusting aspects of
> Christianity, this is a good place to start:

I'm not here to convert unbelievers, so I won't debate that further. But
a small mention of God or the Bible lets them self identify, which saves
time. I don't hate anyone, but why waste time making friends with the
dying and the dead.

As for the subject material, can you help with the format string? I'm
having trouble working around the problem Weiser identified. It doesn't
render the program useless, it just means you need to be careful that
your annotations don't inadvertently match a pattern of patch data.

It would be nice to fix, if possible. If not, the program still does its
job.


R.Wieser

unread,
Mar 3, 2019, 1:44:23 AM3/3/19
to
Rod,

> Eh, what Hell?

To be honest, I have /no/ idea. Its just what most, if not all christians
are threatened with. Funny that, as its led by one of gods own angels. A
supposedly fallen one, but an angel nonetheless.

There seem to be a few more hells though. Like the one for babies that die
before being baptized. As without such a (placed by another human!) "seal
of gods approval" humans are (supposedly) not allowed to enter heaven.
/Regardless/ of if they are the most innocent of innocent.

There is one description of heaven and hell I rather like:

Heaven and hell are the same table, dished with the most delicious of foods.
The guests are all seated. For some reason they cannot lean forward and
their elbows are locked in a straight position). The food is always in
easy reach though. The "hell" people pick up the food, but are unable to
feed themselves. The "heaven" people pick up food, turn sideways and feed
each other.

In other words: Its not the spot that makes heaven or hell, its the people.
Rather profound I would say.

Some people even consider earth to be hell. And they do have a bit of a
point there ...

Regards,
Rudy Wieser


Rod Pemberton

unread,
Mar 3, 2019, 2:18:05 AM3/3/19
to
On Sun, 3 Mar 2019 07:44:17 +0100
"R.Wieser" <add...@not.available> wrote:

> Some people even consider earth to be hell. And they do have a bit
> of a point there ...

FYI, in Christianity, the Earth is Heaven, not that any Christian I've
ever met actually knows that.

Matthew 5:5 - meek shall inherit the Earth
Numbers 12:3 - Moses is the meekest of the meek
Psalm 76:9 - judgment saves the meek
Revelations 20-21 - Earth will be restored

Heaven is also described in Revelations, but it's a gaudy,
jewel-encrusted, abomination designed to tempt the greedy.

Steve Nickolas

unread,
Mar 3, 2019, 2:22:49 AM3/3/19
to
On Sat, 2 Mar 2019, Rod Pemberton wrote:

> Eh, what Hell? "As above, so below" is what some say ... So,
> apparently, there are two Heavens. Ever heard a Satanist say the
> Lord's Prayer? Me neither, but it would clearly have the same words
> but with different meanings.

One of the phrases in the Lord's Prayer sounds suspiciously like "as
above so below" when literally translated. (It's the one traditionally
rendered "on earth as it is in heaven")

-uso.

Kerr-Mudd,John

unread,
Mar 3, 2019, 3:08:53 AM3/3/19
to
On Sat, 02 Mar 2019 19:16:23 GMT, "R.Wieser" <add...@not.available>
wrote:
Have I fallen through a gap from dos programming into alt-flame-war-
religion?


--
Bah, and indeed, Humbug.

R.Wieser

unread,
Mar 3, 2019, 3:57:30 AM3/3/19
to
Rod,

> Matthew 5:5 - meek shall inherit the Earth
> Numbers 12:3 - Moses is the meekest of the meek
> Psalm 76:9 - judgment saves the meek
> Revelations 20-21 - Earth will be restored

Than we have a difference in interpretation there I guess. If I go for just
those titles neither the second nor the third applies. The first and the
last could, and probably do, refer to adam & eves paradise. If it actually
existed that is, and is not, just like that specific hell place of fire and
brimstone led by the devil and his minions, a human invention.

Also, as mentioned before, beeing expected to be "meek" is an invention of
more recent decades (take the crusades for example, ore the even more recent
excommunicating of different-thinkers), which makes me question that
particular translation/interpretation ...

> Heaven is also described in Revelations, but it's a
> gaudy, jewel-encrusted, abomination designed to tempt
> the greedy.

If that would be all that it would be I would not have a problem with it.

But the fact that lots of innocent people are victimized when temptations
get a hold onto someone .... What have those done to deserve to be used
like that ? Just to serve as examples to other greedy people that are
still on the treshold ? Thats a bit (understatement) dark.

I'm not an atheist (my believe in science does not allow me. Proof of his
existance might appear tomorrow), but over time I've become an agnost who
leans against the bottom limit of it.

Religous people refer to it as "lost his faith". To be honest, I don't know
if I ever had one to begin with and was not just going thru the motions to
humour my parents (not that you have, as a child, much to say in it).

Regards,
Rudy Wieser


R.Wieser

unread,
Mar 3, 2019, 4:05:50 AM3/3/19
to
Kerr,

> Have I fallen through a gap from dos programming into alt-flame-war-
> religion?

Looks like it, doesn't it.

But no, its just what happens when some religously believes his program is
faultless - while refusing to listen to anything else.

Regards,
Rudy Wieser


src153

unread,
Mar 3, 2019, 9:56:14 AM3/3/19
to
On Sun, 3 Mar 2019 10:05:46 +0100, "R.Wieser" <add...@not.available>
wrote:

> its just what happens when some religously believes his program is
> faultless - while refusing to listen to anything else.

I posted the fix. Where you at, King Kong? Nothing more to say? Did you
put me in your killfile?

That may be for the best, there's no joy watching your head explode.


src153

unread,
Mar 4, 2019, 11:57:33 AM3/4/19
to
On Fri, 1 Mar 2019 16:58:29 -0500, Rod Pemberton <inv...@lkntrgzxc.com>
wrote:

> It appears to conform to ANSI C.

POSIX says:

https://pubs.opengroup.org/onlinepubs/9699919799/functions/fscanf.html

> Input white-space characters (as specified by isspace) shall be skipped,
> unless the conversion specification includes a [, c, C, or n conversion
> specifier.

So the [ conversion lets you define a subset of whitespace that excludes
newline. The original format

> char fmt[] = "%lx: %x %x%*[ \t]%1[^\n]";

thought of that, but was incomplete. It needed "%*[ \t]" between every
item, not just the last. Even if you squeeze out whitespace between the
items:

> char fmt[] = "%lx:%x%x%*[ \t]%1[^\n]";

It works the same. You don't need whitespace in the format string
between items. Regardless, scanf() still breaks between two items when
encountering any whitespace in the input stream, which by default
includes newline.

Overriding the default newline behavior with "%*[ \t]" between each item
was still not enough to exclude newlines when the items use the %x
format specifier. On the second and third item, I had to replace %x with
a searchset %2[0-9A-Fa-f] that spells out hex characters and limits the
length to 2, and follow that with a call to sscanf() which converts the
now length limited string to an integer. The first item is immediately
followed by a colon (:), so it wasn't necessary on that one.

I don't know if this is a quirk of the Borland C++ 3.1 library, I've not
tested others. But with Borland, the updated format string works.


src153

unread,
Mar 4, 2019, 1:59:35 PM3/4/19
to
On Mon, 04 Mar 2019 16:57:32 +0000, src153 <src...@protocol.invalid>
wrote:

> Overriding the default newline behavior with "%*[ \t]" between each item
> was still not enough to exclude newlines when the items use the %x
> format specifier. On the second and third item, I had to replace %x with
> a searchset %2[0-9A-Fa-f] that spells out hex characters and limits the
> length to 2, and follow that with a call to sscanf() which converts the
> now length limited string to an integer. The first item is immediately
> followed by a colon (:), so it wasn't necessary on that one.

> I don't know if this is a quirk of the Borland C++ 3.1 library

The %x does work with Microsoft C 7.0. So the strange newline behavior
with %x is a Borland quirk. The Borland format string does work with
Microsoft, so it's a work around that can be used for portability if you
care about that.


Rod Pemberton

unread,
Mar 4, 2019, 11:49:50 PM3/4/19
to
Well, my opinion was stated before, that C library implementations of
low use format strings are flaky at best. I personally would call some
of the formats a dark corner of C, of which C has many.

Of course, if you want two dozen self-proclaimed C expert reviewing it
- and maybe one or two real C experts if you're really lucky - you'll
need to re-post the topic to comp.lang.c (without quoting any of us
here, please ... I don't need to hear their attacks.).

src153

unread,
Mar 5, 2019, 10:56:10 AM3/5/19
to
On Mon, 4 Mar 2019 23:52:24 -0500, Rod Pemberton <inv...@lkntrgzxc.com>
wrote:

>Well, my opinion was stated before, that C library implementations of
>low use format strings are flaky at best. I personally would call some
>of the formats a dark corner of C, of which C has many.

It's a good point, but I wanted to explore deeper.


>Of course, if you want two dozen self-proclaimed C expert reviewing it
>- and maybe one or two real C experts if you're really lucky - you'll
>need to re-post the topic to comp.lang.c (without quoting any of us
>here, please ... I don't need to hear their attacks.).

Expert reviews not needed. I did the work to know for sure.

Like Microsoft C 7.0, Microsoft C 6.0 also works with the %x format.
Microsoft 4.0 fails, and I don't have 5.1 to test right now. Borland C++
4.52 fails too.

Was it worth the effort? Maybe no one else cares and are happy to use
fgets() and sscanf(). Whatever works for you. I like to explore, I don't
have a DOS product deadline to meet.


Gene Buckle

unread,
Mar 5, 2019, 12:11:47 PM3/5/19
to
To: Sjouke Burry
Sjouke wrote:
> From Newsgroup: alt.msdos.programmer
You can't reason a person out of a position they didn't reason themselves
into. ;)

g.

--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
http://www.diy-cockpits.org/coll - Go Collimated or Go Home.
Some people collect things for a hobby. Geeks collect hobbies.

ScarletDME - The red hot Data Management Environment
A Multi-Value database for the masses, not the classes.
http://scarlet.deltasoft.com - Get it _today_!
--- Synchronet 3.17c-Win32 NewsLink 1.110
The Retro Archive - telnet://bbs.retroarchive.org

Gene Buckle

unread,
Mar 5, 2019, 12:11:51 PM3/5/19