diff options
author | Andreas Schneider <asn@samba.org> | 2015-01-20 12:07:38 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2015-01-20 18:51:55 +0100 |
commit | 852fda9cb5c18a2454b80b16ab35aece58b53abb (patch) | |
tree | b5c94bf9c2ade29c8f11407e038c4ae826479c18 /README.Coding | |
parent | 6f5ed443226b890d7dc76f525cbd1263a2bed8fd (diff) | |
download | samba-852fda9cb5c18a2454b80b16ab35aece58b53abb.tar.gz |
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.Coding | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/README.Coding b/README.Coding index f19399e7f24..52dca49bede 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"); } |