Section One BBS

Welcome, Guest.


Subject: makenl msgids Date: Mon Jul 29 2019 12:21 am
From: mark lewis To: all

 On 2019 Jul 28 14:14:20, I wrote to you:

 ml> has anyone else noticed that makenl is generating 10 character serial
 ml> numbers?

the problem is here... specifically, %08lx does not set the maximum length...
only the minimum...

    fprintf(MailFILE, "\x01MSGID: %d:%d/%d %08lx\r\n", MyAddress[A_ZONE],
            MyAddress[A_NET], MyAddress[A_NODE], GetSequence());

something like this should work but i'm not a C coder and haven't tried to
actually compile something to test this with...

    char* serialnum = printf("%08lx", GetSequence());
    if (strlen(serialnum) > 8)
    {
      serialnum = serialnum + strlen(serialnum) - 8;
    }
    fprintf(MailFILE, "\x01MSGID: %d:%d/%d %s\r\n", MyAddress[A_ZONE],
            MyAddress[A_NET], MyAddress[A_NODE], serialnum);


)\/(ark

Once men turned their thinking over to machines in the hope that this would set 
them free. But that only permitted other men with machines to enslave them.
... Why do croutons come in airtight packages? It's just stale bread.
---
 * Origin:  (1:3634/12.73)

Previous Message       Next Message
In Reply To: makenl msgids (mark lewis)
Replies: makenl msgids (Andrew Leary)makenl msgids (Vince Coen)