home · contact · privacy
Alarm about / don't start on finding temp file filesaving leftovers.
[plomrogue] / src / server / things.c
index 81d59318cf8e36b19a7cebe0d8ebc68571cc5493..9425f9cc3c315c5362733f93d13d9dbc984ce7a5 100644 (file)
@@ -5,9 +5,10 @@
 #include <stdint.h> /* uint8_t, uint16_t, UINT8_MAX, UINT16_MAX */
 #include <stdlib.h> /* free() */
 #include <string.h> /* memset(), strlen() */
-#include "../common/rexit.h" /* exit_err() */
+#include "../common/rexit.h" /* exit_err(), exit_trouble() */
 #include "../common/try_malloc.h" /* try_malloc() */
 #include "../common/yx_uint8.h" /* yx_uint8 */
+#include "hardcoded_strings.h" /* s */
 #include "map.h" /* is_passable() */
 #include "rrand.h" /* rrand() */
 #include "world.h" /* global world */
@@ -192,7 +193,7 @@ extern struct ThingType * get_thing_type(uint8_t id)
     char * err_intro = "Requested thing type of unused ID ";
     uint16_t size = strlen(err_intro) + 3 + 1 + 1;
     char * err = try_malloc(size, f_name);
-    sprintf(err, "%s%d.", err_intro, id);
+    exit_trouble(sprintf(err,"%s%d.",err_intro,id) < 0,f_name,s[S_FCN_SPRINTF]);
     exit_err(NULL == tt, err);
     free(err);
     return tt;