=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/out.c,v retrieving revision 1.35 retrieving revision 1.36 diff -c -r1.35 -r1.36 *** src/usr.bin/mandoc/out.c 2017/05/01 20:53:58 1.35 --- src/usr.bin/mandoc/out.c 2017/06/08 12:54:40 1.36 *************** *** 1,4 **** ! /* $OpenBSD: out.c,v 1.35 2017/05/01 20:53:58 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2014, 2015, 2017 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: out.c,v 1.36 2017/06/08 12:54:40 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2014, 2015, 2017 Ingo Schwarze *************** *** 38,47 **** * Parse the *src string and store a scaling unit into *dst. * If the string doesn't specify the unit, use the default. * If no default is specified, fail. ! * Return 2 on complete success, 1 when a conversion was done, ! * but there was trailing garbage, and 0 on total failure. */ ! int a2roffsu(const char *src, struct roffsu *dst, enum roffscale def) { char *endptr; --- 38,47 ---- * Parse the *src string and store a scaling unit into *dst. * If the string doesn't specify the unit, use the default. * If no default is specified, fail. ! * Return a pointer to the byte after the last byte used, ! * or NULL on total failure. */ ! const char * a2roffsu(const char *src, struct roffsu *dst, enum roffscale def) { char *endptr; *************** *** 49,55 **** dst->unit = def == SCALE_MAX ? SCALE_BU : def; dst->scale = strtod(src, &endptr); if (endptr == src) ! return 0; switch (*endptr++) { case 'c': --- 49,55 ---- dst->unit = def == SCALE_MAX ? SCALE_BU : def; dst->scale = strtod(src, &endptr); if (endptr == src) ! return NULL; switch (*endptr++) { case 'c': *************** *** 87,98 **** /* FALLTHROUGH */ default: if (SCALE_MAX == def) ! return 0; dst->unit = def; break; } ! ! return *endptr == '\0' ? 2 : 1; } /* --- 87,97 ---- /* FALLTHROUGH */ default: if (SCALE_MAX == def) ! return NULL; dst->unit = def; break; } ! return endptr; } /*