Menu

Git Merge Request #4: Fixes #125 (open)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

Avinash Sonawane wants to merge 3 commits from /u/rootkea/osmo/ to master, 2020-11-22

Commit Date  
2020-11-03 10:50:25 Tree
[47ff3e] by Avinash Sonawane Avinash Sonawane

Remove memcpy()

2020-11-04 04:28:51 Tree
[945880] by Avinash Sonawane Avinash Sonawane

Use g_strlcpy() instead of strncpy()

2020-11-03 09:42:57 Tree

Discussion

  • Maxim Gordienko

    Maxim Gordienko - 2020-11-21

    The change in vcf.c is not correct. content is not a null terminated string but a string split after the last UTF8 character. We want to split it, not to copy it entirely

     
    • Avinash Sonawane

      Ah, in case I'm missing something g_strlcpy(buffer, content, len + 1); copies at most len characters and not the complete content string (which is NULL terminated btw which is why we could use strlen(content) at line 328).

      I fail to understand how g_strlcpy(buffer, content, len + 1); is different than

      strncpy(buffer, content, len);
      buffer[len] = '\0';
      

      the code before the proposed change.

       
  • Avinash Sonawane

     

    Last edit: Avinash Sonawane 2020-11-22

Log in to post a comment.