Forgot your password?
typodupeerror

Comment Re:char Str[255] (Score 1) 683

I realise you probably can't use this trick, but I ran into some of the same issue when building my own functions that used varargs... How to allocate enough space for the return buffer w/o knowing how much space you'd need....

Luckily, you can pass a size to vsnprintf(), and it will return the number of bytes needed if it's more than 'size':

void sys_log (bool s_time, Log_Type type, Log_Level lev, char *fmt, ...) {
    char buf1[2];
    char *buf;
    va_list args;

    va_start (args, fmt);
    num = vsnprintf (buf1, 1, fmt, args);
    buf = malloc (num + 2);
    vsnprintf (buf, num + 1, fmt, args);
    va_end (args); ...
}

Comment Re:Funny... (Score 1) 846

On the other hand, the BREST reactor (a Russian lead-bismuth design) is just great. Can survive on just convection cooling, uses an unreactive moderator, great temperature range, easy maintainance, low waste, anti-proliferation, etc. What isn't there to like? :)
Most people won't support this, if for nothing else, then because it's Russian...

(Just an observation, not intended as inflammatory)

- d.

Slashdot Top Deals

"Take that, you hostile sons-of-bitches!" -- James Coburn, in the finale of _The_President's_Analyst_

Working...