aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/http.c7
-rw-r--r--plugins/irc.c8
-rw-r--r--plugins/ssh.c2
3 files changed, 7 insertions, 10 deletions
diff --git a/plugins/http.c b/plugins/http.c
index cab4246..a38d154 100644
--- a/plugins/http.c
+++ b/plugins/http.c
@@ -102,8 +102,7 @@ scan_init (struct service *service, struct unit *u)
{
(void) service;
- struct str hello;
- str_init (&hello);
+ struct str hello = str_make ();
str_append_printf (&hello, "GET / HTTP/1.0\r\n"
"Host: %s\r\n\r\n", g_data.api->unit_get_address (u));
g_data.api->unit_write (u, hello.str, hello.len);
@@ -114,8 +113,8 @@ scan_init (struct service *service, struct unit *u)
scan->parser.data = scan;
scan->state = STATE_FIELD;
- str_init (&scan->field);
- str_init (&scan->value);
+ scan->field = str_make ();
+ scan->value = str_make ();
scan->u = u;
return scan;
diff --git a/plugins/irc.c b/plugins/irc.c
index 156d4b5..661aead 100644
--- a/plugins/irc.c
+++ b/plugins/irc.c
@@ -56,15 +56,14 @@ scan_init (struct service *service, struct unit *u)
nick[i] = 'a' + rand () % ('z' - 'a' + 1);
nick[i] = '\0';
- struct str hello;
- str_init (&hello);
+ struct str hello = str_make ();
str_append_printf (&hello,
"NICK %s\r\nUSER %s 8 * :%s\r\n", nick, nick, nick);
g_data.api->unit_write (u, hello.str, hello.len);
str_free (&hello);
struct scan_data *scan = xcalloc (1, sizeof *scan);
- str_init (&scan->input);
+ scan->input = str_make ();
scan->u = u;
return scan;
}
@@ -87,8 +86,7 @@ on_irc_message (const struct irc_message *msg, const char *raw, void *user_data)
if (!irc_strcmp (msg->command, "PING"))
{
// Without this we might be unable to finish registration
- struct str pong;
- str_init (&pong);
+ struct str pong = str_make ();
str_append_printf (&pong, "PONG :%s\r\n",
msg->params.len > 0 ? msg->params.vector[0] : "");
g_data.api->unit_write (scan->u, pong.str, pong.len);
diff --git a/plugins/ssh.c b/plugins/ssh.c
index 8ce2e08..11eea1a 100644
--- a/plugins/ssh.c
+++ b/plugins/ssh.c
@@ -42,7 +42,7 @@ scan_init (struct service *service, struct unit *u)
(void) service;
struct scan_data *scan = xcalloc (1, sizeof *scan);
- str_init (&scan->input);
+ scan->input = str_make ();
scan->u = u;
return scan;
}