netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: sripathik@in.ibm.com
Cc: netdev@vger.kernel.org
Subject: bug report: 9p: 9P2010.L handshake: Add mount option
Date: Sat, 6 Mar 2010 15:22:45 +0300	[thread overview]
Message-ID: <20100306122245.GP4958@bicker> (raw)

+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");
}


                 reply	other threads:[~2010-03-06 12:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100306122245.GP4958@bicker \
    --to=error27@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=sripathik@in.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).