diff options
author | dx <aryadevchavali1@gmail.com> | 2020-05-06 03:15:55 +0100 |
---|---|---|
committer | dx <aryadevchavali1@gmail.com> | 2020-05-06 03:15:55 +0100 |
commit | f0001c20f1e5dd4404f317575183a6df5dc7a5f3 (patch) | |
tree | 34b80b407cda9834e09cad4f026a9ff845c28c83 /Converter/src/main.c | |
parent | e779637fc436abbfc7175e613950e52497053976 (diff) | |
download | mdhtml-f0001c20f1e5dd4404f317575183a6df5dc7a5f3.tar.gz mdhtml-f0001c20f1e5dd4404f317575183a6df5dc7a5f3.tar.bz2 mdhtml-f0001c20f1e5dd4404f317575183a6df5dc7a5f3.zip |
~untag -> close_tag
Makes more sense as a variable name.
Diffstat (limited to 'Converter/src/main.c')
-rw-r--r-- | Converter/src/main.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Converter/src/main.c b/Converter/src/main.c index 6dae344..f76a542 100644 --- a/Converter/src/main.c +++ b/Converter/src/main.c @@ -20,21 +20,21 @@ string compile_line(string line, size_t size_of_line) // Generate the header tags based on depth const int tag_size = 4; - const int untag_size = 5; + const int close_tag_size = 5; string tag = malloc(sizeof(*tag) * 5); sprintf(tag, "<h%d>", depth); - string untag = malloc(sizeof(*untag) * 6); - sprintf(untag, "</h%d>", depth); + string close_tag = malloc(sizeof(*close_tag) * 6); + sprintf(close_tag, "</h%d>", depth); // allocate buffer with extra 9 characters for the tags compiled_line = malloc(sizeof(*compiled_line) * - (size_of_line + tag_size + untag_size)); + (size_of_line + tag_size + close_tag_size)); // write h1 to start of compiled_line strncpy(compiled_line, tag, tag_size); // write the rest of the line to the compiled_line strncpy(compiled_line + tag_size, line + depth, size_of_line); // write the end tags - strncpy(compiled_line + size_of_content + tag_size, untag, untag_size); + strncpy(compiled_line + size_of_content + tag_size, close_tag, close_tag_size); } else |