diff options
author | Anton L. Šijanec <anton@sijanec.eu> | 2020-05-02 00:47:52 +0200 |
---|---|---|
committer | Anton L. Šijanec <anton@sijanec.eu> | 2020-05-02 00:47:52 +0200 |
commit | 660e20b37d46da72b4e253360998cb7fa7d5630b (patch) | |
tree | abc1d8ae2e1461ebb2ce28b38327184a7d7ed818 /src/tape.c | |
parent | command detection made possible (diff) | |
download | bverbose-660e20b37d46da72b4e253360998cb7fa7d5630b.tar bverbose-660e20b37d46da72b4e253360998cb7fa7d5630b.tar.gz bverbose-660e20b37d46da72b4e253360998cb7fa7d5630b.tar.bz2 bverbose-660e20b37d46da72b4e253360998cb7fa7d5630b.tar.lz bverbose-660e20b37d46da72b4e253360998cb7fa7d5630b.tar.xz bverbose-660e20b37d46da72b4e253360998cb7fa7d5630b.tar.zst bverbose-660e20b37d46da72b4e253360998cb7fa7d5630b.zip |
Diffstat (limited to 'src/tape.c')
-rw-r--r-- | src/tape.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -64,14 +64,16 @@ int bvr_inline_command_processor(FILE * page_source_file, FILE * temp_output_fil } if(copy_buffer[(ftell(page_source_file)-1)% COPY_BUFFER_SIZE] == CLOSING_COMMAND_TAG_CHAR_1 && copy_buffer[ftell(page_source_file)% COPY_BUFFER_SIZE] == CLOSING_COMMAND_TAG_CHAR_2) { // end of arguments! + /// char argument_string[argument_length+1]; + /// strncpy(argument_string, copy_buffer+(ftell(page_source_file)-(argument_length-1))% COPY_BUFFER_SIZE, argument_length); + copy_buffer[(ftell(page_source_file)-1)% COPY_BUFFER_SIZE] = '\0'; + /// argument_string[argument_length-2] = '\0'; + printf("end of command, command was %c, argument was %s\n", copy_buffer[(ftell(page_source_file)-(1+argument_length))% COPY_BUFFER_SIZE], + /// argument_string); + copy_buffer+(ftell(page_source_file)-(argument_length-1))% COPY_BUFFER_SIZE); // switch (copy_buffer[(ftell(page_source_file)-(1+argument_length))]) { // switch command // // } - char argument_string[argument_length+1]; - strncpy(argument_string, copy_buffer+(ftell(page_source_file)-(argument_length-1)), argument_length); - argument_string[argument_length-2] = '\0'; - printf("end of command, command was %c, argument was \"%s\"\n", copy_buffer[(ftell(page_source_file)-(1+argument_length))], argument_string); - fprintf(temp_output_file, "command was %c, argument was \"%s\"\n", copy_buffer[(ftell(page_source_file)-(1+argument_length))], argument_string); return SUCCESS; } } |