replaced glib function calls to g_snprintf()
authorHolger Schemel <info@artsoft.org>
Fri, 23 Feb 2024 17:28:02 +0000 (18:28 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 23 Feb 2024 17:28:02 +0000 (18:28 +0100)
src/game_bd/bd_c64import.c
src/game_bd/bd_caveset.c

index a88255d9781b8183813e535ec3dbebba7359b95f..921c57f1f0921beb8c7542c0819a22d3705b68f9 100644 (file)
@@ -2355,9 +2355,9 @@ List *gd_caveset_import_from_buffer (const guint8 *buf, gsize length)
 
        /* no name, so we make up one */
        if (newcave->intermission)
-         g_snprintf(newcave->name, sizeof(newcave->name), _("Intermission %d"), cavenum - 15);
+         snprintf(newcave->name, sizeof(newcave->name), _("Intermission %d"), cavenum - 15);
        else
-         g_snprintf(newcave->name, sizeof(newcave->name), _("Cave %c"), 'A' + cavenum);
+         snprintf(newcave->name, sizeof(newcave->name), _("Cave %c"), 'A' + cavenum);
 
        switch(format)
        {
@@ -2407,9 +2407,9 @@ List *gd_caveset_import_from_buffer (const guint8 *buf, gsize length)
 
        newcave->selectable = cavenum % 5 == 0;    /* original selection scheme */
        if (newcave->intermission)
-         g_snprintf(newcave->name, sizeof(newcave->name), _("Intermission %d"), cavenum / 5 + 1);
+         snprintf(newcave->name, sizeof(newcave->name), _("Intermission %d"), cavenum / 5 + 1);
        else
-         g_snprintf(newcave->name, sizeof(newcave->name), _("Cave %c"), 'A'+(cavenum % 5 + cavenum / 5 * 4));
+         snprintf(newcave->name, sizeof(newcave->name), _("Cave %c"), 'A'+(cavenum % 5 + cavenum / 5 * 4));
 
        cavelength = cave_copy_from_dlb (newcave, buf + bufp, length - bufp);
        break;
@@ -2509,14 +2509,14 @@ List *gd_caveset_import_from_buffer (const guint8 *buf, gsize length)
     {
       /* intermission */
       if (numbering)
-       g_snprintf(cave->name, sizeof(cave->name), _("Intermission %02d"), num);
+       snprintf(cave->name, sizeof(cave->name), _("Intermission %02d"), num);
       else
-       g_snprintf(cave->name, sizeof(cave->name), _("Intermission %d"), intermissionnum);
+       snprintf(cave->name, sizeof(cave->name), _("Intermission %d"), intermissionnum);
     } else {
       if (numbering)
-       g_snprintf(cave->name, sizeof(cave->name), _("Cave %02d"), num);
+       snprintf(cave->name, sizeof(cave->name), _("Cave %02d"), num);
       else
-       g_snprintf(cave->name, sizeof(cave->name), _("Cave %c"), 'A' - 1 + cavenum);
+       snprintf(cave->name, sizeof(cave->name), _("Cave %c"), 'A' - 1 + cavenum);
     }
 
     num++;
index 49b6e1003a3ce3af82d66ecc5f23d43429107531..d04b54c704b8ad5a070da154498a4e534c31aab3 100644 (file)
@@ -318,11 +318,11 @@ static void brc_import(guint8 *data)
       imported[level * 20 + cavenum] = cave;
 
       if (cavenum < 16)
-       g_snprintf(cave->name, sizeof(GdString), "Cave %c/%d", 'A' + cavenum,
-                  level + 1);
+       snprintf(cave->name, sizeof(GdString), "Cave %c/%d", 'A' + cavenum,
+                level + 1);
       else
-       g_snprintf(cave->name, sizeof(GdString), "Intermission %d/%d",
-                  cavenum - 15, level + 1);
+       snprintf(cave->name, sizeof(GdString), "Intermission %d/%d",
+                cavenum - 15, level + 1);
 
       /* fixed intermission caves; are smaller. */
       if (cavenum >= 16)