home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.os.vms      DEC's VAX* line of computers & VMS.      264,096 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 262,705 of 264,096   
   Lawrence D'Oliveiro to All   
   Re: FreeTDS port to VMS V9.x on x86?   
   24 Jun 25 01:41:18   
   
   From: ldo@nz.invalid   
      
   On Mon, 23 Jun 2025 20:40:21 -0400, Arne Vajhøj wrote:   
      
   > On 6/23/2025 8:37 PM, Lawrence D'Oliveiro wrote:   
   >>   
   >> What a dumb way to do it. Using the null device means making OS I/O   
   >> calls -- needless overhead just to find out how long a string -- which   
   >> is being put together entirely in userland -- needs to be.   
   >   
   > But if you have a simple better way of achieving it ...   
      
   snprintf(3) and vsnprintf(3) return the total number of bytes needed for   
   the final result. So just call them once with all the right arguments and   
   a zero-length buffer, and use the result to allocate a buffer of the right   
   length, and call them again.   
      
      
      
   And of course you should be using va_end(3) and va_start(3) again before   
   the second call. This allows for traversing the argument list multiple   
   times.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca