move the text of error messages from ERROR to the functions
[unix-history] / usr / src / usr.bin / pascal / libpc / MAX.c
CommitLineData
e7f5228a
KM
1/* Copyright (c) 1979 Regents of the University of California */
2
86997b19 3static char sccsid[] = "@(#)MAX.c 1.4 %G%";
e7f5228a
KM
4
5#include "h00vars.h"
e7f5228a 6
492cc5d3 7long
e7f5228a
KM
8MAX(width, reduce, min)
9
492cc5d3
KM
10 register long width; /* requested width */
11 long reduce; /* amount of extra space required */
12 long min; /* minimum amount of space needed */
e7f5228a 13{
a9946ed6 14 if (width <= 0) {
86997b19 15 ERROR("Non-positive format width: %D\n", width);
e7f5228a
KM
16 return;
17 }
18 if ((width -= reduce) >= min)
19 return width;
20 return min;
21}