-/* $OpenBSD: printf.c,v 1.27 2021/05/07 14:31:27 martijn Exp $ */
+/* $OpenBSD: printf.c,v 1.28 2024/08/26 03:49:06 deraadt Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
start = fmt++;
if (*fmt == '%') {
- putchar ('%');
+ putchar('%');
break;
} else if (*fmt == 'b') {
char *p = getstr();
}
if (!*fmt) {
- warnx ("missing format character");
+ warnx("missing format character");
return(1);
}
break;
}
default:
- warnx ("%s: invalid directive", start);
+ warnx("%s: invalid directive", start);
return(1);
}
*(fmt + 1) = nextch;
break;
default:
- putchar (*fmt);
+ putchar(*fmt);
break;
}
}
value <<= 3;
value += octtobin(*str);
}
- putchar (value);
+ putchar(value);
str--;
} else if (*str == 'c') {
return 1;
str += print_escape(str);
}
} else {
- putchar (*str);
+ putchar(*str);
}
str++;
}
value <<= 4;
value += hextobin(*str);
}
- putchar (value);
+ putchar(value);
return str - start - 1;
/* NOTREACHED */
return (unsigned char) *((*gargv++)+1);
errno = 0;
- val = strtol (*gargv, &ep, 0);
+ val = strtol(*gargv, &ep, 0);
check_conversion(*gargv++, ep);
return val;
}
return (unsigned char) *((*gargv++)+1);
errno = 0;
- val = strtoul (*gargv, &ep, 0);
+ val = strtoul(*gargv, &ep, 0);
check_conversion(*gargv++, ep);
return val;
}
return (unsigned char) *((*gargv++)+1);
errno = 0;
- val = strtod (*gargv, &ep);
+ val = strtod(*gargv, &ep);
check_conversion(*gargv++, ep);
return val;
}
{
if (*ep) {
if (ep == s)
- warnx ("%s: expected numeric value", s);
+ warnx("%s: expected numeric value", s);
else
- warnx ("%s: not completely converted", s);
+ warnx("%s: not completely converted", s);
rval = 1;
} else if (errno == ERANGE) {
warnc(ERANGE, "%s", s);