summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/fat.c4
-rw-r--r--firmware/drivers/lcd-16bit.c2
-rw-r--r--firmware/drivers/lcd-1bit-vert.c2
-rw-r--r--firmware/drivers/lcd-2bit-vert.c2
-rw-r--r--firmware/drivers/lcd-2bit-vi.c2
-rw-r--r--firmware/drivers/lcd-charcell.c2
6 files changed, 7 insertions, 7 deletions
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c
index 2ff4c61ac4..a710593a69 100644
--- a/firmware/drivers/fat.c
+++ b/firmware/drivers/fat.c
@@ -1183,7 +1183,7 @@ static int write_long_name(struct fat_file* file,
1183 /* shortname entry */ 1183 /* shortname entry */
1184 unsigned short date=0, time=0, tenth=0; 1184 unsigned short date=0, time=0, tenth=0;
1185 LDEBUGF("Shortname entry: %s\n", shortname); 1185 LDEBUGF("Shortname entry: %s\n", shortname);
1186 strncpy(entry + FATDIR_NAME, shortname, 11); 1186 memcpy(entry + FATDIR_NAME, shortname, 11);
1187 entry[FATDIR_ATTR] = is_directory?FAT_ATTR_DIRECTORY:0; 1187 entry[FATDIR_ATTR] = is_directory?FAT_ATTR_DIRECTORY:0;
1188 entry[FATDIR_NTRES] = 0; 1188 entry[FATDIR_NTRES] = 0;
1189 1189
@@ -1271,7 +1271,7 @@ static int add_dir_entry(struct fat_dir* dir,
1271 /* The "." and ".." directory entries must not be long names */ 1271 /* The "." and ".." directory entries must not be long names */
1272 if(dotdir) { 1272 if(dotdir) {
1273 int i; 1273 int i;
1274 strncpy(shortname, name, 12); 1274 strlcpy(shortname, name, 12);
1275 for(i = strlen(shortname); i < 12; i++) 1275 for(i = strlen(shortname); i < 12; i++)
1276 shortname[i] = ' '; 1276 shortname[i] = ' ';
1277 1277
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c
index ef0865fc8c..882bfa0854 100644
--- a/firmware/drivers/lcd-16bit.c
+++ b/firmware/drivers/lcd-16bit.c
@@ -1152,7 +1152,7 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
1152 } 1152 }
1153 1153
1154 end = strchr(s->line, '\0'); 1154 end = strchr(s->line, '\0');
1155 strncpy(end, string, current_vp->width/2); 1155 strlcpy(end, string, current_vp->width/2);
1156 1156
1157 s->vp = current_vp; 1157 s->vp = current_vp;
1158 s->y = y; 1158 s->y = y;
diff --git a/firmware/drivers/lcd-1bit-vert.c b/firmware/drivers/lcd-1bit-vert.c
index 5fb652431c..f11fd6fdf9 100644
--- a/firmware/drivers/lcd-1bit-vert.c
+++ b/firmware/drivers/lcd-1bit-vert.c
@@ -845,7 +845,7 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
845 } 845 }
846 846
847 end = strchr(s->line, '\0'); 847 end = strchr(s->line, '\0');
848 strncpy(end, string, current_vp->width/2); 848 strlcpy(end, string, current_vp->width/2);
849 849
850 s->vp = current_vp; 850 s->vp = current_vp;
851 s->y = y; 851 s->y = y;
diff --git a/firmware/drivers/lcd-2bit-vert.c b/firmware/drivers/lcd-2bit-vert.c
index 801927eb37..57d27d2ead 100644
--- a/firmware/drivers/lcd-2bit-vert.c
+++ b/firmware/drivers/lcd-2bit-vert.c
@@ -1154,7 +1154,7 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
1154 } 1154 }
1155 1155
1156 end = strchr(s->line, '\0'); 1156 end = strchr(s->line, '\0');
1157 strncpy(end, (char *)string, current_vp->width/2); 1157 strlcpy(end, (char *)string, current_vp->width/2);
1158 1158
1159 s->vp = current_vp; 1159 s->vp = current_vp;
1160 s->y = y; 1160 s->y = y;
diff --git a/firmware/drivers/lcd-2bit-vi.c b/firmware/drivers/lcd-2bit-vi.c
index 1c0a717d13..0a73f0dd25 100644
--- a/firmware/drivers/lcd-2bit-vi.c
+++ b/firmware/drivers/lcd-2bit-vi.c
@@ -1167,7 +1167,7 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
1167 } 1167 }
1168 1168
1169 end = strchr(s->line, '\0'); 1169 end = strchr(s->line, '\0');
1170 strncpy(end, (char *)string, current_vp->width/2); 1170 strlcpy(end, (char *)string, current_vp->width/2);
1171 1171
1172 s->vp = current_vp; 1172 s->vp = current_vp;
1173 s->y = y; 1173 s->y = y;
diff --git a/firmware/drivers/lcd-charcell.c b/firmware/drivers/lcd-charcell.c
index ca5809899f..33337daf19 100644
--- a/firmware/drivers/lcd-charcell.c
+++ b/firmware/drivers/lcd-charcell.c
@@ -496,7 +496,7 @@ void lcd_puts_scroll_offset(int x, int y, const unsigned char *string,
496 } 496 }
497 497
498 end = strchr(s->line, '\0'); 498 end = strchr(s->line, '\0');
499 strncpy(end, string, utf8seek(s->line, current_vp->width)); 499 strlcpy(end, string, utf8seek(s->line, current_vp->width));
500 500
501 s->vp = current_vp; 501 s->vp = current_vp;
502 s->y = y; 502 s->y = y;