diff --git a/src/p_setup.c b/src/p_setup.c
index 102c9b9a72e047887d6f4a773c82bbeffe80a691..d3e91d71ab264f75d74bb202c972f3d4265bf752 100644
--- a/src/p_setup.c
+++ b/src/p_setup.c
@@ -1341,7 +1341,7 @@ static void P_LoadSidedefs(UINT8 *data)
 						|| (msd->toptexture[0] >= 'A' && msd->toptexture[0] <= 'F'))
 						sd->toptexture = axtoi(msd->toptexture);
 					else
-						I_Error("Custom FOF (line id %d) needs a value in the linedef's back side upper texture field.", sd->line - lines);
+						I_Error("Custom FOF (line id %s) needs a value in the linedef's back side upper texture field.", sizeu1(sd->line - lines));
 
 					sd->midtexture = R_TextureNumForName(msd->midtexture);
 					sd->bottomtexture = R_TextureNumForName(msd->bottomtexture);