summaryrefslogtreecommitdiffstats
path: root/README.Coding
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2015-01-20 12:07:38 +0100
committerVolker Lendecke <vl@samba.org>2015-01-20 18:51:55 +0100
commit852fda9cb5c18a2454b80b16ab35aece58b53abb (patch)
treeb5c94bf9c2ade29c8f11407e038c4ae826479c18 /README.Coding
parent6f5ed443226b890d7dc76f525cbd1263a2bed8fd (diff)
downloadsamba-852fda9cb5c18a2454b80b16ab35aece58b53abb.tar.gz
samba-852fda9cb5c18a2454b80b16ab35aece58b53abb.tar.xz
samba-852fda9cb5c18a2454b80b16ab35aece58b53abb.zip
CodingStyle: Update example to use our coding practice.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Jan 20 18:51:55 CET 2015 on sn-devel-104
Diffstat (limited to 'README.Coding')
-rw-r--r--README.Coding8
1 files changed, 4 insertions, 4 deletions
diff --git a/README.Coding b/README.Coding
index f19399e7f2..52dca49bed 100644
--- a/README.Coding
+++ b/README.Coding
@@ -280,8 +280,8 @@ Good Examples:
int ret = 0;
if (y < 10) {
- z = malloc(sizeof(int)*y);
- if (!z) {
+ z = malloc(sizeof(int) * y);
+ if (z == NULL) {
ret = 1;
goto done;
}
@@ -290,7 +290,7 @@ Good Examples:
print("Allocated %d elements.\n", y);
done:
- if (z) {
+ if (z != NULL) {
free(z);
}
@@ -352,7 +352,7 @@ debugger.
Good example:
x = malloc(sizeof(short)*10);
- if (!x) {
+ if (x == NULL) {
fprintf(stderr, "Unable to alloc memory!\n");
}