A LOT updates. Cannot separate. :)
[silc.git] / lib / silcutil / silcbuffmt.c
index 3399ccb14f4828ad77dba7ac34c3b37d4020694d..54cf0e2c2a37a38c10d53ce223d93df2b9f51b99 100644 (file)
    is too short. Must be fixed. There are some other obvious bugs as
    well. */
 /*
- * $Id$
- * $Log$
- * Revision 1.1  2000/09/13 17:45:16  priikone
- *     Splitted SILC core library. Core library includes now only
- *     SILC protocol specific stuff. New utility library includes the
- *     old stuff from core library that is more generic purpose stuff.
- *
- * Revision 1.2  2000/07/05 06:06:35  priikone
- *     Global cosmetic change.
- *
- * Revision 1.1.1.1  2000/06/27 11:36:55  priikone
- *     Imported from internal CVS/Added Log headers.
- *
- *
- */
+ * $Id$ */
 
 #include "silcincludes.h"
 
@@ -62,14 +48,14 @@ int silc_buffer_format(SilcBuffer dst, ...)
     switch(fmt) {
     case SILC_BUFFER_PARAM_SI8_CHAR:
       {
-       char x = va_arg(ap, char);
+       char x = (char)va_arg(ap, int);
        silc_buffer_put(dst, &x, 1);
        silc_buffer_pull(dst, 1);
        break;
       }
     case SILC_BUFFER_PARAM_UI8_CHAR:
       {
-       unsigned char x = va_arg(ap, unsigned char);
+       unsigned char x = (unsigned char)va_arg(ap, int);
        silc_buffer_put(dst, &x, 1);
        silc_buffer_pull(dst, 1);
        break;
@@ -77,7 +63,7 @@ int silc_buffer_format(SilcBuffer dst, ...)
     case SILC_BUFFER_PARAM_SI16_SHORT:
       {
        unsigned char xf[2];
-       short x = va_arg(ap, short);
+       short x = (short)va_arg(ap, int);
        SILC_PUT16_MSB(x, xf);
        silc_buffer_put(dst, xf, 2);
        silc_buffer_pull(dst, 2);
@@ -86,7 +72,7 @@ int silc_buffer_format(SilcBuffer dst, ...)
     case SILC_BUFFER_PARAM_UI16_SHORT:
       {
        unsigned char xf[2];
-       unsigned short x = va_arg(ap, unsigned short);
+       unsigned short x = (unsigned short)va_arg(ap, int);
        SILC_PUT16_MSB(x, xf);
        silc_buffer_put(dst, xf, 2);
        silc_buffer_pull(dst, 2);