Skip to content

Commit

Permalink
CodingStyle: Update example to use our coding practice.
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Schneider <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>

Autobuild-User(master): Volker Lendecke <[email protected]>
Autobuild-Date(master): Tue Jan 20 18:51:55 CET 2015 on sn-devel-104
  • Loading branch information
cryptomilk authored and vlendec committed Jan 20, 2015
1 parent 6f5ed44 commit 852fda9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.Coding
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -290,7 +290,7 @@ Good Examples:
print("Allocated %d elements.\n", y);

done:
if (z) {
if (z != NULL) {
free(z);
}

Expand Down Expand Up @@ -352,7 +352,7 @@ debugger.
Good example:

x = malloc(sizeof(short)*10);
if (!x) {
if (x == NULL) {
fprintf(stderr, "Unable to alloc memory!\n");
}

Expand Down

0 comments on commit 852fda9

Please sign in to comment.