# Fmtscan ## PR 1. git fetch 2. check branch for merging PR 3. [Practice](https://youtu.be/FDXSgyDGmho?si=L-vkwHZkEDnz6aP8) - ya, just merge it on two remotes. 4. Do the PR or Rebase in the branch 5. Finish ## Previous words Pull Request 274 was made by me , `Urbaner3`, in `lab0`/ `sysprog21`. And it was closed for Rework and submit pull requests later. So I am working here to submit another pull request. ```diff (base) urbaner@urbaner-wtumagic:~/linux2025/lab0-c$ git commit --- modified web.c +++ expected coding style @@ -257,7 +257,9 @@ int web_eventmux(char *buf) accept(server_fd, (struct sockaddr *) &clientaddr, &clientlen); char *p = web_recv(web_connfd, &clientaddr); - char *buffer = "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n\r\n""<link rel=\"shortcut icon\" href=\"#\">"; + char *buffer = + "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n\r\n" + "<link rel=\"shortcut icon\" href=\"#\">"; web_send(web_connfd, buffer); strncpy(buf, p, strlen(p) + 1); free(p); [!] web.c does not follow the consistent coding style. Make sure you indent as the following: clang-format -i web.c Following files were changed: - web.c : 1 insertions(+), 1 deletions(-) Running fmtscan... href rel 8119 lines scanned (0.253M bytes) 53 printf style statements being processed 2 unique bad spellings found (2 non-unique) ``` New report shows that it is not just printf would be checked. But everything between quotation marks. ## 0405 to commit message Title: Fix: condition statements in fmtscan.c Message: A warning from static analysis from fmtscan.c tells us conditions of 2 branches might conflict. There is a likely macro to check if it's end of the parsor. And the other branch is using a function to see if parsor get a valid digit. So I slightly copy the first condition and put it together with the condition in the latter branch. And It turns out static analysis accept the condition statements. >Running static analysis... tools/fmtscan.c:664:26: warning: Either the condition 'nextch2!=256' is redundant or isxdigit() argument nr 1 can have invalid value. The value is 256 but the valid values are '0:255'. [invalidFunctionArg] ### Decision I decided not to make the pull request, instead I would post an article on Facebook forum to say that the issue is about to catch and trace the bug and PR is an evolution on the system. Since this time I only got minor cases on typo, only few cases of words not in the dictionary cause the error. They might be keywords and essential but in that case all you have to do is to modify the dictionary not to cause a revolution on the system or to trace on minor cases of bugs. It's really a shame of focus. Just discuss it in the forum instead. ### Ref [STAR manner](https://wiki.mbalib.com/zh-tw/STAR%E5%8E%9F%E5%88%99) [lab0_PR274](https://github.com/sysprog21/lab0-c/pull/274) [fb_fmt_error_msg](https://www.facebook.com/groups/system.software2025/permalink/945106757826126/) [fb_post](https://www.facebook.com/groups/system.software2025/permalink/953051833698285/) [issue_279](https://github.com/sysprog21/lab0-c/issues/279#issuecomment-2764587491) [lkml_patch](https://lkml.org/lkml/2025/3/25/441) [lkml_archive_mirror](https://lore.kernel.org/lkml/?q=vsprintf%3A+Add+__printf+attribut) [same_issue](https://hackmd.io/@ShanXD/HkzVsB_sJg#%E7%A0%94%E8%AE%80-Linux-%E6%A0%B8%E5%BF%83%E5%8E%9F%E5%A7%8B%E7%A8%8B%E5%BC%8F%E7%A2%BC%E7%9A%84-liblist_sortc)-eric895888 - shan [howto_issue](https://rewind.com/blog/best-practices-for-using-github-issues/) >Enhance the descriptions by focusing on executable subtasks. >--By Jserv