Navigation


Changeset 1358:cf411b1dcbbb in freeDiameter


Ignore:
Timestamp:
May 29, 2019, 11:36:32 PM (5 years ago)
Author:
Thomas Klausner <tk@giga.or.at>
Branch:
default
Children:
1359:09f94b1bedc3, 1362:56f9e13f0ef0
Phase:
public
Message:

Improve compatibility with old systems.

Use c_str() to get C strings for printing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/dict_json/json-schema-to-c.cc

    r1355 r1358  
    3838#include <string.h>
    3939#include <sys/stat.h>
     40#include <unistd.h>
    4041
    4142#include <json/SchemaValidator.h>
     
    9293    off_t n = stat_buf.st_size;
    9394    if (max_size > 0 && n > max_size) {
    94         fprintf (stderr, "%s file [%s] is larger than %" PRIi64 " bytes\n", desc, filename, (int64_t)max_size);
     95        fprintf (stderr, "%s file [%s] is larger than %lld bytes\n", desc, filename, (long long)max_size);
    9596        fclose (fp);
    9697        return NULL;
     
    9899    char *buf;
    99100    if ((buf = (char *) malloc ((size_t)n+1)) == NULL) {
    100         fprintf (stderr, "error allocating %" PRIi64 " bytes for read of %s file [%s]\n", (int64_t)n, desc, filename);
     101        fprintf (stderr, "error allocating %lld bytes for read of %s file [%s]\n", (long long)n, desc, filename);
    101102        fclose (fp);
    102103        return NULL;
     
    181182    Json::Value json;
    182183    if (!reader.parse(str, json)) {
    183         fprintf(stderr, "%s: parse error: %s\n", input, reader.getFormattedErrorMessages());
     184        fprintf(stderr, "%s: parse error: %s\n", input, reader.getFormattedErrorMessages().c_str());
    184185        exit(1);
    185186    }
Note: See TracChangeset for help on using the changeset viewer.