Use snprintf to avoid nonsensical Clang warnings

int
lericson 2010-05-10 12:20:14 +02:00
parent 2b39ddf9ec
commit 5c059a0ccd
1 changed files with 1 additions and 2 deletions

View File

@ -1314,8 +1314,7 @@ Oh, and: plankton.\n");
for (err = PylibMCExc_mc_errs; err->name != NULL; err++) {
char excnam[64];
strncpy(excnam, "_pylibmc.", 64);
strncat(excnam, err->name, 64);
snprintf(excnam, 64, "_pylibmc.%s", err->name);
err->exc = PyErr_NewException(excnam, PylibMCExc_MemcachedError, NULL);
PyModule_AddObject(module, err->name, (PyObject *)err->exc);
PyList_Append(exc_objs,