ISO C says that the arguments to memcmp() must be nonnull even if the
size argument is 0, so don't do that.
Found by Clang (http://clang-analyzer.llvm.org).
/*
- * Copyright (c) 2008 Nicira Networks.
+ * Copyright (c) 2008, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
return ((a->data != NULL) == (b->data != NULL)
&& a->n == b->n
- && !memcmp(a->data, b->data, a->n));
+ && (!a->data || !memcmp(a->data, b->data, a->n)));
}
/* Replaces 'ds' by a string representation of 'msg'. If 'multiline' is