Skip to content

Commit

Permalink
Fix OpenBSD complaints about strcpy, sprintf.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Ford committed Oct 1, 2010
1 parent 45c4f58 commit cbf4ba4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vm/agent.cpp
Expand Up @@ -311,7 +311,7 @@ namespace rubinius {
pid_t pid = getpid();
ss << tmpdir << "/rubinius-agent." << pid;

strcpy(tmp_path, ss.str().c_str());
strncpy(tmp_path, ss.str().c_str(), ss.str().size());
std::ofstream stream(tmp_path);

// Couldn't open the path, for whatever reason.
Expand Down
2 changes: 1 addition & 1 deletion vm/builtin/io.cpp
Expand Up @@ -635,7 +635,7 @@ namespace rubinius {
break;
#endif
default:
sprintf(pbuf, "unknown:%d", addr->sa_family);
snprintf(pbuf, NI_MAXSERV, "unknown:%d", addr->sa_family);
family = String::create(state, pbuf);
break;
}
Expand Down

0 comments on commit cbf4ba4

Please sign in to comment.