/[svn]/libgig/trunk/src/helper.h
ViewVC logotype

Diff of /libgig/trunk/src/helper.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3858 by schoenebeck, Sat Feb 1 12:06:25 2020 UTC revision 3859 by schoenebeck, Sun Feb 14 14:21:55 2021 UTC
# Line 2  Line 2 
2   *                                                                         *   *                                                                         *
3   *   libgig - C++ cross-platform Gigasampler format file access library    *   *   libgig - C++ cross-platform Gigasampler format file access library    *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003-2020 by Christian Schoenebeck                      *   *   Copyright (C) 2003-2021 by Christian Schoenebeck                      *
6   *                              <cuse@users.sourceforge.net>               *   *                              <cuse@users.sourceforge.net>               *
7   *                                                                         *   *                                                                         *
8   *   This library is free software; you can redistribute it and/or modify  *   *   This library is free software; you can redistribute it and/or modify  *
# Line 28  Line 28 
28  #include <string>  #include <string>
29  #include <sstream>  #include <sstream>
30  #include <algorithm>  #include <algorithm>
31    #include <assert.h>
32    
33  #if defined(WIN32) && !HAVE_CONFIG_H && !defined(_MSC_VER)  #if defined(WIN32) && !HAVE_CONFIG_H && !defined(_MSC_VER)
34  # include "../win32/libgig_private.h" // like config.h, automatically generated by Dev-C++  # include "../win32/libgig_private.h" // like config.h, automatically generated by Dev-C++
# Line 65  inline std::string strPrint(const char* Line 66  inline std::string strPrint(const char*
66      va_list args;      va_list args;
67      va_start(args, fmt);      va_start(args, fmt);
68      char* buf = NULL;      char* buf = NULL;
69      vasprintf(&buf, fmt, args);      const int n = vasprintf(&buf, fmt, args);
70      std::string res = buf;      assert(n >= 0);
71        std::string res = (buf && n > 0) ? buf : "";
72      if (buf) free(buf);      if (buf) free(buf);
73      va_end(args);      va_end(args);
74      return res;      return res;

Legend:
Removed from v.3858  
changed lines
  Added in v.3859

  ViewVC Help
Powered by ViewVC