Fixed all remaining linter warnings
authorLukas Krickl <lukas@krickl.dev>
Mon, 19 Feb 2024 06:05:29 +0000 (07:05 +0100)
committerLukas Krickl <lukas@krickl.dev>
Mon, 19 Feb 2024 06:05:29 +0000 (07:05 +0100)
src/ulas.c

index 45b4651043727706478df81d97ea739f0131f9a7..541ab577d0b1032b7054f461959aa637dc2afd22 100644 (file)
@@ -85,11 +85,11 @@ FILE *ulas_incpathfopen(const char *path, const char *mode) {
       continue;
     }
 
-    strcat(pathbuf, ip);
+    strlcat(pathbuf, ip, ULAS_PATHMAX);
     if (ip[len - 1] != ULAS_PATHSEP[0]) {
-      strcat(pathbuf, ULAS_PATHSEP);
+      strlcat(pathbuf, ULAS_PATHSEP, ULAS_PATHMAX);
     }
-    strcat(pathbuf, path);
+    strlcat(pathbuf, path, ULAS_PATHMAX);
 
     FILE *f = fopen(pathbuf, mode);
     if (f != NULL) {
@@ -2285,7 +2285,7 @@ void ulas_asmout(FILE *dst, const char *outbuf, unsigned long n) {
 
   if (ulas.address < 0x14C) {
     for (int i = 0; i < n; i++) {
-      ulas.chksm = ulas.chksm - outbuf[i] - 1;
+      ulas.chksm = (char)(ulas.chksm - outbuf[i] - 1);
     }
   }
 }