Changeset 180 for cpp/common


Ignore:
Timestamp:
03/18/14 09:11:39 (11 years ago)
Author:
Maciej Komosinski
Message:

Remove fixed length buffers

Location:
cpp/common
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/framsg.cpp

    r122 r180  
    55#include "framsg.h"
    66#include <common/nonstd_stdio.h>
     7#include "stl-util.h"
    78#include "Convert.h"
    89
     
    1112void FMprintf_va(const char *o,const char *m,int w,const char *bl,va_list va)
    1213{
    13         char buf[10000];
    14         vsnprintf(buf,10000,bl,va);
    15         FramMessage(o,m,buf,w);
     14        string buf=ssprintf_va(bl,va);
     15        FramMessage(o,m,buf.c_str(),w);
    1616}
    1717
  • cpp/common/stl-util.h

    r140 r180  
    77
    88#include "nonstd_stl.h"
     9#include <stdarg.h>
    910
    1011template<typename T, std::size_t N> void push_back(vector<T>& v, T(&d)[N])
     
    3738
    3839string ssprintf(const char* format, ...);
     40string ssprintf_va(const char* format, va_list ap);
    3941
    4042string stripExt(const string& filename); // strip extension from filename
     43string getFileExt(const string& filename); // get extension (starting with ".") from filename
    4144
    4245bool readCompleteFile(const char* filename, vector<char>& data, bool warn_on_missing_file=true);
Note: See TracChangeset for help on using the changeset viewer.