[hackers] [scc] [cc2] fix calloc call in nextpc() || Quentin Rameau

From: <git_AT_suckless.org>
Date: Tue, 21 Jun 2016 21:10:59 +0200 (CEST)

commit 0914984fe8a45e5928b4f975ee7530574452f19d
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Tue Jun 21 21:09:12 2016 +0200
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Tue Jun 21 21:09:12 2016 +0200

    [cc2] fix calloc call in nextpc()
    
    I forgot to modify the function call and to include the correct header
    in previous 92ec299 commit.

diff --git a/cc2/code.c b/cc2/code.c
index 35c4041..8d4bc69 100644
--- a/cc2/code.c
+++ b/cc2/code.c
_AT_@ -1,6 +1,7 @@
 /* See LICENSE file for copyright and license details. */
 #include <stdlib.h>
 
+#include "../inc/cc.h"
 #include "arch.h"
 #include "cc2.h"
 
_AT_@ -11,7 +12,7 @@ nextpc(void)
 {
         Inst *new;
 
- new = xcalloc(sizeof(*new)); /* TODO: create an arena */
+ new = xcalloc(1, sizeof(*new)); /* TODO: create an arena */
 
         if (!pc) {
                 prog = new;
Received on Tue Jun 21 2016 - 21:10:59 CEST

This archive was generated by hypermail 2.3.0 : Tue Jun 21 2016 - 21:12:25 CEST