| 63 static gboolean gs_idle_cb(gpointer data); |
63 static gboolean gs_idle_cb(gpointer data); |
| 64 |
64 |
| 65 PurpleStringref *purple_stringref_new(const char *value) |
65 PurpleStringref *purple_stringref_new(const char *value) |
| 66 { |
66 { |
| 67 PurpleStringref *newref; |
67 PurpleStringref *newref; |
| |
68 size_t len; |
| 68 |
69 |
| 69 if (value == NULL) |
70 if (value == NULL) |
| 70 return NULL; |
71 return NULL; |
| 71 |
72 |
| 72 newref = g_malloc(sizeof(PurpleStringref) + strlen(value)); |
73 len = strlen(value); |
| 73 strcpy(newref->value, value); |
74 |
| |
75 newref = g_malloc(sizeof(PurpleStringref) + len); |
| |
76 g_strlcpy(newref->value, value, len); |
| 74 newref->ref = 1; |
77 newref->ref = 1; |
| 75 |
78 |
| 76 return newref; |
79 return newref; |
| 77 } |
80 } |
| 78 |
81 |