strnlwr (char* start_l ,int n)
{
char * p = start_l + n;
- while ( --p >= start_l) {
+ while (--p >= start_l)
+ {
*p = tolower (*p); /* a macro on some compilers */
}
return start_l;
strnupr (char* start_l, int n)
{
char * p = start_l + n;
- while ( --p >= start_l) {
+ while (--p >= start_l)
+ {
*p = toupper (*p); /* a macro on some compilers */
}
return start_l;
char *
memmem (Byte const * haystack, int haystack_len,
- Byte const *needle,int needle_len)
+ Byte const *needle,int needle_len)
{
Byte const * end_haystack = haystack + haystack_len - needle_len;
Byte const * end_needle = needle + needle_len ;
/* Ahhh ... Some minimal lowlevel stuff. This *is* nice; Varation
- is the spice of life */
- while (haystack < end_haystack) {
+ is the spice of life */
+ while (haystack < end_haystack)
+ {
Byte const *subneedle_l = needle;
Byte const *subhaystack_l = haystack;
- while (subneedle_l < end_needle) {
+ while (subneedle_l < end_needle)
+ {
if (*subneedle_l++ != *subhaystack_l++)
goto next; // yeah. I should be prosecuted.
}
memrchr (Byte const * p, int n, char c)
{
const Byte * q = p+n;
- while (q > p) {
+ while (q > p)
+ {
if (*--q == c)
return (Byte*)q;
}
Byte*
strrev (Byte* byte_l, int length_i)
{
- Byte tmp_byte;
+ Byte tmp_byte;
- Byte* left_l = byte_l;
- Byte* right_l = byte_l + length_i;
+ Byte* left_l = byte_l;
+ Byte* right_l = byte_l + length_i;
- while ( right_l > left_l) {
- my_swap (*right_l-- , *left_l++ , tmp_byte);
- }
- return byte_l;
+ while (right_l > left_l)
+ {
+ my_swap (*right_l-- , *left_l++ , tmp_byte);
+ }
+ return byte_l;
}
#if ! HAVE_SNPRINTF
-int snprintf ( char *str, size_t,
+int snprintf (char *str, size_t,
char const *format, ...)
{
va_list ap;