bug report: 9p: 9P2010.L handshake: Add mount option
From: Dan Carpenter <hidden>
Date: 2010-03-06 12:23:02
From: Dan Carpenter <hidden>
Date: 2010-03-06 12:23:02
+static unsigned char get_protocol_version(const substring_t *name)
+{
+ unsigned char version = -EINVAL;
Assigning a negative value to an unsigned char is problematic. (If it's
an unsigned int or long that's different).
I have included a test program to illustrate.
regards,
dan carpenter
#include <stdio.h>
unsigned char n22(void) { return -22; }
int main()
{
int ret = n22();
if (ret == -22)
printf("true\n");
else
printf("false\n");
}