summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-25 05:36:55 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-25 05:36:55 +0000
commit85911c410a6b367ba3555f5e86c8e33db37344af (patch)
tree1a97c77f3d15e4d031b24462bc4e04ded804645b /ext
parent43601a1d171333cccea5d656e0f18b77cb1ff987 (diff)
* ext/socket/socket.c (tcp_s_gethostbyname): was using
uninitialized size_t value. [ruby-talk:76946] * Minor cleanups. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/socket/socket.c3
-rw-r--r--ext/syck/emitter.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 87ca9b8..9b1bf7f 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -1092,7 +1092,6 @@ tcp_s_gethostbyname(obj, host)
struct hostent *h = sock_hostbyname(host);
VALUE ary, names;
char **pch;
- size_t size;
ary = rb_ary_new();
rb_ary_push(ary, rb_str_new2(h->h_name));
@@ -1124,7 +1123,7 @@ tcp_s_gethostbyname(obj, host)
#ifdef SIN6_LEN
sin6.sin6_len = sizeof(sin6);
#endif
- memcpy((char*)&sin6.sin6_addr, *pch, size);
+ memcpy((char*)&sin6.sin6_addr, *pch, h->h_length);
rb_ary_push(ary, mkipaddr((struct sockaddr*)&sin6));
break;
}
diff --git a/ext/syck/emitter.c b/ext/syck/emitter.c
index 07cd84e..ed47260 100644
--- a/ext/syck/emitter.c
+++ b/ext/syck/emitter.c
@@ -192,7 +192,7 @@ syck_emitter_flush( SyckEmitter *e, long check_room )
{
char *header = S_ALLOC_N( char, 64 );
S_MEMZERO( header, char, 64 );
- sprintf( header, "--- %YAML:%d.%d ", SYCK_YAML_MAJOR, SYCK_YAML_MINOR );
+ sprintf( header, "--- %%YAML:%d.%d ", SYCK_YAML_MAJOR, SYCK_YAML_MINOR );
(e->handler)( e, header, strlen( header ) );
S_FREE( header );
}