~ubuntu-branches/ubuntu/precise/wine1.4/precise

« back to all changes in this revision

Viewing changes to dlls/msxml3/main.c

  • Committer: Package Import Robot
  • Author(s): Scott Ritchie
  • Date: 2012-02-15 23:48:21 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20120215234821-1uy0h2zvj27oyfjr
Tags: 1.4~rc4-0ubuntu1
* New upstream release
  - Bug fixes only, we are in code freeze.
* debian/control:
  - On amd64, depend on wine1.4-i386 | wine1.4-dev
    This is a compromise to allow the build daemons to use wine1.4-dev on amd64
  - On amd64, recommend wine1.4-i386.  This should make it installed except
    in exceptional circumstances (eg installation during archive skew)

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
 
63
63
void wineXmlCallbackLog(char const* caller, xmlErrorLevel lvl, char const* msg, va_list ap)
64
64
{
65
 
    char* buf = NULL;
66
 
    int len = 32, needed;
67
 
    enum __wine_debug_class dbcl = __WINE_DBCL_ERR;
 
65
    static const int max_size = 200;
 
66
    enum __wine_debug_class dbcl;
 
67
    char buff[max_size];
 
68
    int len;
 
69
 
68
70
    switch (lvl)
69
71
    {
70
72
        case XML_ERR_NONE:
74
76
            dbcl = __WINE_DBCL_WARN;
75
77
            break;
76
78
        default:
 
79
            dbcl = __WINE_DBCL_ERR;
77
80
            break;
78
81
    }
79
82
 
80
 
    do
81
 
    {
82
 
        heap_free(buf);
83
 
        buf = heap_alloc(len);
84
 
        needed = vsnprintf(buf, len, msg, ap);
85
 
        if (needed == -1)
86
 
            len *= 2;
87
 
        else if (needed >= len)
88
 
            len = needed + 1;
89
 
        else
90
 
            needed = 0;
91
 
    }
92
 
    while (needed);
 
83
    len = vsnprintf(buff, max_size, msg, ap);
 
84
    if (len == -1 || len >= max_size) buff[max_size-1] = 0;
93
85
 
94
 
    wine_dbg_log(dbcl, &__wine_dbch_msxml, caller, "%s", buf);
95
 
    heap_free(buf);
 
86
    wine_dbg_log(dbcl, &__wine_dbch_msxml, caller, "%s", buff);
96
87
}
97
88
 
98
89
void wineXmlCallbackError(char const* caller, xmlErrorPtr err)
105
96
    case XML_ERR_WARNING: dbcl = __WINE_DBCL_WARN; break;
106
97
    default:              dbcl = __WINE_DBCL_ERR; break;
107
98
    }
108
 
    wine_dbg_log(dbcl, &__wine_dbch_msxml, caller, "%s", debugstr_a(err->message));
 
99
 
 
100
    wine_dbg_log(dbcl, &__wine_dbch_msxml, caller, "error code %d", err->code);
 
101
    if (err->message)
 
102
        wine_dbg_log(dbcl, &__wine_dbch_msxml, caller, ": %s", err->message);
 
103
    else
 
104
        wine_dbg_log(dbcl, &__wine_dbch_msxml, caller, "\n");
109
105
}
110
106
 
111
107
/* Support for loading xml files from a Wine Windows drive */