Reply to post: Researches did not read the C spec.

GitHub's Copilot may steer you into dangerous waters about 40% of the time – study

MacroRodent

Researches did not read the C spec.

> sprintf(buf, "%f", 1E300) will generate a massive string.

Actually, it wont! The standard says that if precision omitted in %f, like it is here, it is assumed to be 6.

So the 20-character array allocated is actually overkill.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon