diff options
| author | andreask <andreask> | 2012-08-27 17:12:06 (GMT) |
|---|---|---|
| committer | andreask <andreask> | 2012-08-27 17:12:06 (GMT) |
| commit | f490a484008e7824b249e53c67dba1df6aa83494 (patch) | |
| tree | b0f08ba55851c5470ae19a767294afead361c59b | |
| parent | a18efd5aa224c63b91d5af4992c29ca5f6ccf554 (diff) | |
| download | tcl-f490a484008e7824b249e53c67dba1df6aa83494.zip tcl-f490a484008e7824b249e53c67dba1df6aa83494.tar.gz tcl-f490a484008e7824b249e53c67dba1df6aa83494.tar.bz2 | |
Followup to [6325d5dbeac6f91d28d6]. dlerror() may return NULL. Fixed the code which wasn't prepared to deal with that.
| -rw-r--r-- | unix/tclLoadDl.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c index f8fe6d3..a48aa23 100644 --- a/unix/tclLoadDl.c +++ b/unix/tclLoadDl.c @@ -176,8 +176,14 @@ FindSymbol( } Tcl_DStringFree(&ds); if (proc == NULL && interp != NULL) { + const char *errorStr = dlerror(); + + if (!errorStr) { + errorStr = "unknown"; + } + Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "cannot find symbol \"%s\": %s", symbol, dlerror())); + "cannot find symbol \"%s\": %s", symbol, errorStr)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, NULL); } |
