Fix "minor optimizations"

Andreas Schwab schwab@suse.de
Fri Nov 12 15:21:00 GMT 2004


What was called "minor optimizations" completely broke the function.

Andreas.

2004-11-12  Andreas Schwab  <schwab@suse.de>

	* nis/ypclnt.c (ypprot_err): Fix "minor optimizations".

--- nis/ypclnt.c.~1.48.~	2004-10-25 11:33:36.000000000 +0200
+++ nis/ypclnt.c	2004-11-12 14:56:22.034832503 +0100
@@ -844,9 +844,9 @@ static const int8_t yp_2_yperr[] =
 int
 ypprot_err (const int code)
 {
-  if (code < YP_VERS || code > YP_NOKEY)
+  if (code < YP_VERS || code > YP_TRUE)
     return YPERR_YPERR;
-  return yp_2_yperr[code];
+  return yp_2_yperr[code - YP_VERS];
 }
 libnsl_hidden_def (ypprot_err)
 

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Libc-hacker mailing list