Slashdot Mirror


User: Sauron

Sauron's activity in the archive.

Stories
0
Comments
3
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 3

  1. Re:char Str[255] on Dirty Coding Tricks To Make a Deadline · · Score: 1

    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); ...
    }

  2. Re:Funny... on China to Pioneer Melt-Down Proof Reactors · · Score: 1
    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.
  3. Re:How to Donate Blood on U.S. Attack -- More Updates · · Score: 1

    According to the police scanner just now, blood donations can be given at any NYC hospital.