On Thu, Feb 03, 2005 at 03:42:57PM -0500, Jonathan Glass wrote:
> This works for compiling, but tell me what you get when you try to run
> flow-capture.  I've tested on x86_64 and i386, and 0.59-0.67 give the same
> error in syslog:
> 
> Feb  3 13:03:02 cambia2 flow-capture[21683]:
> ftfile_mkpath(2005/tmp-v05.2005-02-03.130302-0500): Value too large for
> defined data type

flow-tools erroneously assumes that 'unsigned int' == 'long' and that
'unsigned int' == 'unsigned 32 bit int'. the former is not true in 64
bit platforms and the latter is hazardous, but less likely to break much.

ftlib.h:#define u_int32 unsigned int
                           v-----------------------------unsigned int
ftfile.c:int ftfile_mkpath(u_int32 ftime, int nest)

struct file {
  [...]
  time_t time; <--- gentoo may define this as 'long' which is 64bit on 64bit 
archs
  [...]
}

> I'm at a loss.

%%
#include <sys/types.h>
#include <time.h>
int
main(void)
{
        printf("%u ?= %u\n", sizeof(time_t), sizeof(unsigned int));
}
%%

compile that:
$ cc -o foo foo.c
$ ./foo

i'd go on about posix and such, but there's plenty of docs available on
what the 'right way' of manipulating/displaying fixed sizes in C is.

-- 
- bill fumerola / [EMAIL PROTECTED]


_______________________________________________
Flow-tools mailing list
[EMAIL PROTECTED]
http://mailman.splintered.net/mailman/listinfo/flow-tools

Reply via email to