OSDN Git Service

#37287 #37353 (2.2.0.89) REAL_TIME 型を再定義し、型の置換を継続中。 / Re-define REAL_TIME, ongoing...
[hengband/hengband.git] / src / z-form.c
index 1030143..69d4995 100644 (file)
@@ -1,4 +1,12 @@
-/* File: z-form.c */
+/* File: z-form.c */
+
+/*
+ * Copyright (c) 1997 Ben Harrison
+ *
+ * This software may be copied and distributed for educational, research,
+ * and not for profit purposes provided that this copyright and statement
+ * are included in all such copies.
+ */
 
 /* Purpose: Low level text formatting -BEN- */
 
@@ -458,7 +466,7 @@ uint vstrnfmt(char *buf, uint max, cptr fmt, va_list vp)
                                arg = va_arg(vp, int);
 
                                /* Format the argument */
-                               sprintf(tmp, aux, arg);
+                               sprintf(tmp, "%c", arg);
 
                                /* Done */
                                break;
@@ -502,7 +510,6 @@ uint vstrnfmt(char *buf, uint max, cptr fmt, va_list vp)
                                        /* Access next argument */
                                        arg = va_arg(vp, unsigned long);
 
-                                       /* Format the argument */
                                        sprintf(tmp, aux, arg);
                                }
                                else
@@ -511,9 +518,8 @@ uint vstrnfmt(char *buf, uint max, cptr fmt, va_list vp)
 
                                        /* Access next argument */
                                        arg = va_arg(vp, unsigned int);
-
-                                       /* Format the argument */
                                        sprintf(tmp, aux, arg);
+
                                }
 
                                /* Done */
@@ -569,7 +575,7 @@ uint vstrnfmt(char *buf, uint max, cptr fmt, va_list vp)
                                arg2[1023] = '\0';
 
                                /* Format the argument */
-                               sprintf(tmp, aux, arg2);
+                               sprintf(tmp, aux, arg);
 
                                /* Done */
                                break;
@@ -585,7 +591,7 @@ uint vstrnfmt(char *buf, uint max, cptr fmt, va_list vp)
                                arg = va_arg(vp, vptr);
 
                                /* Format the "user data" */
-                               (void)vstrnfmt_aux(tmp, 1000, aux, arg);
+                               sprintf(tmp, aux, arg);
 
                                /* Done */
                                break;
@@ -605,7 +611,7 @@ uint vstrnfmt(char *buf, uint max, cptr fmt, va_list vp)
 
 
 #ifdef JP
-                  for (q = 0; tmp[q]; q++) if ( iskanji(tmp[q]) ) { do_xtra=FALSE;break;} 
+               for (q = 0; tmp[q]; q++) if (iskanji(tmp[q])) { do_xtra=FALSE;break;} 
 #endif
                /* Mega-Hack -- handle "capitilization" */
                if (do_xtra)
@@ -614,14 +620,11 @@ uint vstrnfmt(char *buf, uint max, cptr fmt, va_list vp)
                        for (q = 0; tmp[q]; q++)
                        {
                                /* Notice first non-space */
-                               if (!isspace(tmp[q]))
+                               if (!iswspace(tmp[q]))
                                {
                                        /* Capitalize if possible */
-#ifdef JP
-                                       if (!iskanji(tmp[q]))
-#endif
-                                               if (islower(tmp[q]))
-                                                       tmp[q] = toupper(tmp[q]);
+                                       if (islower(tmp[q]))
+                                               tmp[q] = (char)toupper(tmp[q]);
 
                                        /* Done */
                                        break;