From 7f482a809aabce6d2ca2a2b3b6b5f1ad491292c2 Mon Sep 17 00:00:00 2001 From: Ry Date: Sat, 4 Mar 2023 17:00:38 -0800 Subject: [PATCH] Remove extra new line in disk error messages --- src/disk.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/disk.c b/src/disk.c index 27ea0f7..fad1aaa 100644 --- a/src/disk.c +++ b/src/disk.c @@ -16,7 +16,7 @@ disk_controller_t disk_controller; extern fox32_vm_t vm; void new_disk(const char *filename, size_t id) { - if (id > 3) { puts("attempting to access disk with ID > 3\n"); return; } + if (id > 3) { puts("attempting to access disk with ID > 3"); return; } printf("mounting %s as disk ID %d\n", filename, (int) id); disk_controller.disks[id].file = fopen(filename, "r+b"); if (!disk_controller.disks[id].file) { @@ -29,35 +29,35 @@ void new_disk(const char *filename, size_t id) { } void insert_disk(disk_t disk, size_t id) { - if (id > 3) { puts("attempting to access disk with ID > 3\n"); return; } + if (id > 3) { puts("attempting to access disk with ID > 3"); return; } if (disk_controller.disks[id].size > 0) remove_disk(id); printf("mounting disk ID %d\n", (int) id); disk_controller.disks[id] = disk; } void remove_disk(size_t id) { - if (id > 3) { puts("attempting to access disk with ID > 3\n"); return; } + if (id > 3) { puts("attempting to access disk with ID > 3"); return; } printf("unmounting disk ID %d\n", (int) id); fclose(disk_controller.disks[id].file); disk_controller.disks[id].size = 0; } uint64_t get_disk_size(size_t id) { - if (id > 3) { puts("attempting to access disk with ID > 3\n"); return 0; } + if (id > 3) { puts("attempting to access disk with ID > 3"); return 0; } return disk_controller.disks[id].size; } void set_disk_sector(size_t id, uint64_t sector) { - if (id > 3) { puts("attempting to access disk with ID > 3\n"); return; } + if (id > 3) { puts("attempting to access disk with ID > 3"); return; } fseek(disk_controller.disks[id].file, sector * 512, 0); } size_t read_disk_into_memory(size_t id) { - if (id > 3) { puts("attempting to access disk with ID > 3\n"); return 0; } + if (id > 3) { puts("attempting to access disk with ID > 3"); return 0; } return fread(&vm.memory_ram[disk_controller.buffer_pointer], 1, 512, disk_controller.disks[id].file); } size_t write_disk_from_memory(size_t id) { - if (id > 3) { puts("attempting to access disk with ID > 3\n"); return 0; } + if (id > 3) { puts("attempting to access disk with ID > 3"); return 0; } return fwrite(&vm.memory_ram[disk_controller.buffer_pointer], 1, 512, disk_controller.disks[id].file); }