The Boston Diaries

The ongoing saga of a programmer who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal “The Boston Diaries.”

Go figure.

Friday, July 01, 2022

“I'm sorry I mistakenly sent that to you. By the way, how are things with you?”

The fact that these scammers never include the pitch in their opening texts makes them seem confusing and mysterious. But the scam itself is an old and obvious one. If you respond (with “wrong number,” say) the scammer will attempt to draw you into conversation …

This is the first step in what is, at its core, an old-fashioned “romance scam,” in which the scammer exploits a lonely and/or horny person by faking a long-distance, usually romantic relationship. After the scammer has gained the trust of their victim, they convince them to transfer money, often for an investment; in some cases, the victim can be enticed into several successive transfers before they realize they’re being played.

Via Hacker News, What's the deal with all those weird wrong-number texts?

I think this explains the weird email I received two weeks ago. It's either that, or maybe (with low probability given the email sent) a form of “crypto drainer” as was suggested.

Wednesday, July 13, 2022

I think Mac OS-X is wrong in this case, and Linux is right

There was apparently a frantic bug-hunt involving “Project: Lumbergh” yesterday that I was not involved in. From the description of the bug, it certainly sounded like it was a manifestation of “undefined behavior” as “Project: Lumbergh” was actinging differently between Linux and Mac OS-X (our testing and development platforms). The issue stemmed from this bit of code (not the exact code, but similar in nature):

x = strtol(input,&endptr,10);
if ((errno == 0) && (endptr != input))
/* ... */

And the fix:

errno = 0; /* BUG FIX */
x = strtol(input,&endptr,10);
if ((errno == 0) && (endptr != input))
/* ... */

In fact, there are man pages that show setting errno to 0 in sample code. Here's what the C99 Standard says about library functions setting errno:

The value of errno is zero at program startup, but is never set to zero by any library function. The value of errno may be set to nonzero by a library function call whether or not there is an error, provided the use of errno is not documented in the description of the function in this International Standard.

C99 Standard, section 7.5.3

So no function will ever set errno to 0. To me, this sounds like some earlier failed function causing a false problem in this bit of code, thus the fix to set errno to 0. Now, the C99 Standard says this about strtol():

The strtol, strtoll, strtoul, and strtoull functions return the converted value, if any. If no conversion could be performed, zero is returned. If the correct value is outside the range of representable values, LONG_MIN, LONG_MAX, LLONG_MIN, LLONG_MAX, ULONG_MAX, or ULLONG_MAX is returned (according to the return type and sign of the value, if any), and the value of the macro ERANGE is stored in errno.

C99 Standard, section

And indeed, on both Linux and Mac OS-X, for values outside the given range, ERANGE is returned. The issue happens when no conversion happens. Both systems return 0, but Linux doesn't set errno whereas Mac OS-X does. In fact, Mac OS-X sets errno to EINVAL, which isn't even defined in the C99 Standard (but it is defined for POSIX). I think Mac OS-X has the wrong behavior here. errno is documented in the description of strtol() (but only for one error case), so Mac OS-X shouldn't be (in my opinion) errno when there's a conversion issue.

It may be a moot point though, as the fix appears to be working as intended on both systems.

Monday, July 18, 2022

A screed against modern consumer electronics

So I'm watching this video on a mouse/scanner combo thing when at the very end, Cathode Ray Dude goes on a rant about the companies that make modern consumer electronics that I found amusing. I also think it's a sad state of affairs that I agree with his sentiment that most consumer electronic companies exist just to get bought out and not to sell a viable product.

Obligatory Picture

[The future's so bright, I gotta wear shades]

Obligatory Contact Info

Obligatory Feeds

Obligatory Links

Obligatory Miscellaneous

You have my permission to link freely to any entry here. Go ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site:, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.

You may also note subtle shading of the links and that's intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It's an experiment in using color shading to denote the distance a link is from here. If you don't notice it, don't worry; it's not all that important.

It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.

Copyright © 1999-2024 by Sean Conner. All Rights Reserved.