Commit 51fa3b74 authored by Tim Peters's avatar Tim Peters

Tkapp_New(): Rewrite in C so it compiles again.

parent edcac8f4
...@@ -580,6 +580,7 @@ Tkapp_New(char *screenName, char *baseName, char *className, ...@@ -580,6 +580,7 @@ Tkapp_New(char *screenName, char *baseName, char *className,
{ {
TkappObject *v; TkappObject *v;
char *argv0; char *argv0;
v = PyObject_New(TkappObject, &Tkapp_Type); v = PyObject_New(TkappObject, &Tkapp_Type);
if (v == NULL) if (v == NULL)
return NULL; return NULL;
...@@ -646,13 +647,15 @@ Tkapp_New(char *screenName, char *baseName, char *className, ...@@ -646,13 +647,15 @@ Tkapp_New(char *screenName, char *baseName, char *className,
/* some initial arguments need to be in argv */ /* some initial arguments need to be in argv */
if (sync || use) { if (sync || use) {
char *args;
int len = 0; int len = 0;
if (sync) if (sync)
len += sizeof "-sync"; len += sizeof "-sync";
if (use) if (use)
len += strlen(use) + sizeof "-use "; len += strlen(use) + sizeof "-use ";
char *args = (char*)ckalloc(len); args = (char*)ckalloc(len);
if (!args) { if (!args) {
PyErr_NoMemory(); PyErr_NoMemory();
Py_DECREF(v); Py_DECREF(v);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment