From 63bdcda971db7d4b806c32197637b0e62413472d Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 13 Feb 2002 21:26:24 +0000 Subject: [PATCH] Fix for Linux on zSeries. --- libraries/liblber/encode.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/liblber/encode.c b/libraries/liblber/encode.c index 0b351a3582..9affa46c67 100644 --- a/libraries/liblber/encode.c +++ b/libraries/liblber/encode.c @@ -403,8 +403,7 @@ ber_put_boolean( ber_tag_t tag ) { ber_len_t taglen; - unsigned char trueval = (unsigned char) -1; - unsigned char falseval = 0; + unsigned char c; assert( ber != NULL ); assert( LBER_VALID( ber ) ); @@ -420,7 +419,9 @@ ber_put_boolean( return -1; } - if ( ber_write( ber, (char *)(boolval ? &trueval : &falseval), 1, 0 ) + c = boolval ? (unsigned char) ~0U : (unsigned char) 0U; + + if ( ber_write( ber, (char *) &c, 1, 0 ) != 1 ) { return -1; -- 2.39.5