summaryrefslogtreecommitdiff
path: root/lcd.c
diff options
context:
space:
mode:
authorroot <root@fedora-arm.domain.avtechpulse.com>1999-12-31 20:14:04 -0500
committerroot <root@fedora-arm.domain.avtechpulse.com>1999-12-31 20:14:04 -0500
commit1688816ac1a6390764a1d7b242a5b2fdacebd938 (patch)
treeb3b0b23c7cc5924ef135bf64ead86bebc1daddcf /lcd.c
parentecd33bd78e0caef597d3bad272ac239ffda74d24 (diff)
use g_str instead of malloc
Diffstat (limited to 'lcd.c')
-rw-r--r--lcd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lcd.c b/lcd.c
index 79b39a9..1658efa 100644
--- a/lcd.c
+++ b/lcd.c
@@ -29,14 +29,14 @@ static void break_up_string (char *in_string, int N, char *str1, char *str2, cha
char *copy_input;
char *p;
- j=k=copypos=0;
+ j=k=copypos=0;
input_length=strlen(in_string);
copy_input = g_strdup(in_string);
for (j=0; j<SUBSTRING_CNT; j++) {
- char * interm_str= (char *)malloc((N+1)*sizeof(char));
- memset(interm_str,0, (N+1)*sizeof(char));
+ gchar *interm_str = g_strnfill (N, 0);
+
for (k=0; k<N; k++) {
copypos++; // next symbol
if (copypos>input_length) {
@@ -84,7 +84,7 @@ static void break_up_string (char *in_string, int N, char *str1, char *str2, cha
strcpy(str3,interm_str);
break;
}
- free(interm_str);
+ g_free(interm_str);
}