Subject: make_named_packet

From: Michael Han <[email-masked]>
Date: Mon, 08 May 2000 21:53:29 -0700

So I'm poking around in the module interface trying to figure out what
might be going on with the problem reported by [email-masked]
(strange output of errors in FvwmConsole and FvwmDebug). While I was
looking at fvwm/module_interface.c (make_named_packet) I notice the
line:

*len = FvwmPacketHeaderSize + num + (strlen(name) / sizeof(unsigned
long)) + 1;

In which len is to be the number of ulongs in the packet... Wouldn't
this truncate chars if the string failed to align on ulong boundaries?
Or am I getting confused? Basically, shouldn't the above be:

*len = FvwmPacketHeaderSize + num +
       (strlen(name) / sizeof(unsigned long)) +
       (strlen(name) % sizeof(unsigned long)) ? 1 : 0) + 1;

Unfortunately, I don't think this has any relevance to the problem I'm
trying to figure out, but it just struck me as odd.
-- 
[email-masked]                         http://www.best.com/~mikehan/
coffee achiever                              San Francisco, California
"Compulsory education is inconstitutional" - graffitti I saw in the subway
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 9 May 2000 07:39:25 +0200

> trying to figure out, but it just struck me as odd.

No that calculation is correct:

  strlen    bytes to store string    ulongs
  0                1                   1
  1                2                   1
  2                3                   1
  3                4                   1
  4                5                   2
  5                6                   2
  ...              ...                 ...

I think you forgot to consider the byte for the terminating zero
and the '+1' at the end of the line.

Bye

Dominik ^_^

-- 
Dominik Vogt, Agilent Technologies, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/464-4596, fax: 07031/464-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]