-/* 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- */
/* Save the character */
buf[n++] = *s++;
-
- /* Continue */
continue;
}
/* Skip the "%" */
s++;
-
- /* Continue */
continue;
}
/* Skip the "n" */
s++;
-
- /* Continue */
continue;
}
/* Skip the "r" */
s++;
-
- /* Continue */
continue;
}
arg = va_arg(vp, int);
/* Format the argument */
- sprintf(tmp, aux, arg);
+ sprintf(tmp, "%c", arg);
- /* Done */
break;
}
sprintf(tmp, aux, arg);
}
- /* Done */
break;
}
/* Access next argument */
arg = va_arg(vp, unsigned long);
- /* Format the argument */
sprintf(tmp, aux, arg);
}
else
/* Access next argument */
arg = va_arg(vp, unsigned int);
-
- /* Format the argument */
sprintf(tmp, aux, arg);
+
}
- /* Done */
break;
}
/* Format the argument */
sprintf(tmp, aux, arg);
- /* Done */
break;
}
/* Format the argument */
sprintf(tmp, aux, arg);
- /* Done */
break;
}
arg2[1023] = '\0';
/* Format the argument */
- sprintf(tmp, aux, arg2);
+ sprintf(tmp, aux, arg);
- /* Done */
break;
}
arg = va_arg(vp, vptr);
/* Format the "user data" */
- (void)vstrnfmt_aux(tmp, 1000, aux, arg);
+ sprintf(tmp, aux, arg);
- /* Done */
break;
}
- /* Oops */
default:
{
/* Error -- illegal format char */
#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)
for (q = 0; tmp[q]; q++)
{
/* Notice first non-space */
- if (!isspace(tmp[q]))
+ if (!iswspace(tmp[q]))
{
/* Capitalize if possible */
- if (islower(tmp[q])) tmp[q] = toupper(tmp[q]);
+ if (islower(tmp[q]))
+ tmp[q] = (char)toupper(tmp[q]);
- /* Done */
break;
}
}