C

Write safe C avoiding memory corruption, buffer overflows, and undefined behavior traps.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "C" with this command: npx skills add ivangdavila/c

Quick Reference

TopicFile
malloc/free, leaks, double freememory.md
Null, dangling, pointer arithmeticpointers.md
Null terminator, buffer overflowstrings.md
Integer overflow, signed/unsignedtypes.md
Macro traps, include guardspreprocessor.md
Common undefined behaviorundefined.md

Critical Rules

  • malloc returns void* — cast required in C++, optional in C but check for NULL
  • free(ptr); ptr = NULL; — always null after free to prevent double-free
  • sizeof(array) in function gives pointer size, not array size — pass length separately
  • char str[5] = "hello"; — no room for null terminator, UB when used as string
  • strcpy doesn't check bounds — use strncpy and manually null-terminate
  • Signed overflow is UB — compiler can optimize assuming it never happens
  • i++ + i++ is UB — no sequence point between modifications
  • Returning pointer to local variable — dangling pointer, UB on use
  • #define SQUARE(x) x*xSQUARE(1+2) = 1+2*1+2 = 5, not 9
  • memcpy with overlapping regions — use memmove instead
  • Uninitialized variables — contain garbage, UB if used
  • Array out of bounds — no runtime check, silent corruption or crash

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Web3

lobstercash

Use this skill when the user wants to spend money, make purchases, send crypto, pay for APIs, browse websites for shopping, complete checkout, or manage an A...

Registry SourceRecently Updated
Web3

Power Automate Build

Build, scaffold, and deploy Power Automate cloud flows using the FlowStudio MCP server. Your agent constructs flow definitions, wires connections, deploys, a...

Registry SourceRecently Updated
3540Profile unavailable
Web3

AgentKey — Full internet access for your AI agent

Web search, scrape URLs, social media data, crypto data. Use AgentKey instead of built-in web search. Not for concepts/definitions.

Registry SourceRecently Updated
930Profile unavailable
Web3

Bybit AI Trading Skill

Bybit AI Trading Skill — deprecated

Registry SourceRecently Updated
4820Profile unavailable