Displaying 17 results from an estimated 17 matches for "new_str".
2010 Mar 11
2
[PATCH FOR DISCUSSION ONLY] Rewrite libguestfs-supermin-helper in C.
..._append_stat (hostfile, &statbuf);
+ } /* Ignore files that don't exist. */
+ }
+}
+
+/*----------*/
+/* Helper functions. *NOTE* we never bother to free anything. */
+
+static void
+add_string (char ***argv, size_t *size, size_t *alloc, const char *str)
+{
+ char **new_argv;
+ char *new_str;
+
+ if (*size >= *alloc) {
+ *alloc += 64;
+ new_argv = realloc (*argv, *alloc * sizeof (char *));
+ if (new_argv == NULL) {
+ perror ("realloc");
+ exit (EXIT_FAILURE);
+ }
+ *argv = new_argv;
+ }
+
+ if (str) {
+ new_str = strdup (str);
+ if (new_st...
2011 Nov 11
3
[PATCH v2] Add mdadm-create, list-md-devices APIs.
This adds the mdadm-create API for creating RAID devices, and
includes various fixes for the other two patches.
Rich.
2001 Sep 10
1
not safe to return vector pointer
...lo All,
I recently upgraded from R-1.1.1 to R-1.2.2.
I have an R function that uses .Call() to
return a list from C code. The C code
has the form:
SEXP function(SEXP var)
{
SEXP rlist ;
PROTECT(rlist = NEW_LIST(3)) ;
VECTOR_PTR(rlist)[0] = NEW_INTEGER(1) ;
VECTOR_PTR(rlist)[1] = NEW_STRING(1) ;
...
UNPROTECT(1) ;
return(rlist) ;
}
When I try to .Call("function",...) from R I get
the following error message:
Error: not safe to return vector pointer
Why is it no longer safe to return a vector pointer?
How can I correct this problem?
Thanks in advance,
Chri...
2003 Apr 28
1
Wine compile error in tools/wpp (ppl.l) under debian
...cit declaration of function `newline'
./ppl.l:330: `tNL' undeclared (first use in this function)
./ppl.l:338: warning: implicit declaration of function `make_number'
./ppl.l:338: `pplval' undeclared (first use in this function)
./ppl.l:339: warning: implicit declaration of function `new_string'
./ppl.l:339: warning: implicit declaration of function `add_string'
./ppl.l:339: `pp_iqs' undeclared (first use in this function)
./ppl.l:340: `pp_dqs' undeclared (first use in this function)
./ppl.l:344: called object is not a function
./ppl.l:366: `pp_defined' undeclared (...
2012 Mar 13
2
[PATCH 0/2] 'int' to 'size_t' changes
These two patches are probably not completely independent, but
separating them is a lot of work.
With *both* patches applied, all the tests and extra-tests pass.
That's no guarantee however that there isn't a mistake, so I don't
think this patch is a candidate for the 1.16 branch, until it's had a
lot more testing in development.
Rich.
2024 Aug 14
3
[Bug 3717] New: Stricter sshd absolute path requirement breaks xinetd
.../*
* Determine server name
*/
server_name = strrchr( SC_SERVER(scp), '/' ) ;
if ( server_name == NULL )
server_name = SC_SERVER(scp) ;
else
server_name++ ; /* skip the '/' */
/*
* Place it in argv[ 0 ]
*/
SC_SERVER_ARGV(scp)[ 0 ] = new_string( server_name ) ;
I think what xinetd is doing here is perhaps a little silly, but it's
also quite widely deployed. Would something like the attached patch
make sense?
Alternatively, I wonder whether this code is in the wrong place
following the listener/session split. It would make a lot...
2005 Dec 19
8
Simply Ruby question: "zerofill"
Hi there-
What''s the easiest/most efficient way to perform a zerofill in Ruby?
i.e. Given the value ''val'', I would like to do something like:
val = 43
puts val.zerofill(8)
---> "00000043"
gsub? sprintf of some sort?
Jake
--
Posted via http://www.ruby-forum.com/.
2011 Jun 09
15
[PATCH 00/13] Fix errors found using Coverity static analyzer.
I ran the Coverity static analyzer[1] on libguestfs, and fixed many
errors as a result.
Coverity found some errors in gnulib, but it doesn't seem to be worth
following those up since the version of gnulib we are using is so old.
There are a couple more errors (possibly 1 false-positive) which I'm
going to send in a separate email.
BTW all the errors found by Coverity were in the daemon
2016 Jul 07
0
[PATCH 2/2] daemon: fix cleanup of stringsbuf usages
...loc * sizeof (char *));
if (new_argv == NULL) {
reply_with_perror ("realloc");
- free_stringslen (sb->argv, sb->size);
- sb->argv = NULL;
free (str);
return -1;
}
@@ -533,8 +531,6 @@ add_string (struct stringsbuf *sb, const char *str)
new_str = strdup (str);
if (new_str == NULL) {
reply_with_perror ("strdup");
- free_stringslen (sb->argv, sb->size);
- sb->argv = NULL;
return -1;
}
}
@@ -554,8 +550,6 @@ add_sprintf (struct stringsbuf *sb, const char *fs, ...)
va_end (args);
if...
2016 Jul 07
2
[PATCH 1/2] daemon: free the string on stringsbuf add failure
If add_string_nodup fails free the passed string instead of leaking it,
as that string would have been owned by the stringbuf.
Adapt few places to this behaviour.
---
daemon/btrfs.c | 4 +---
daemon/devsparts.c | 8 ++++----
daemon/guestfsd.c | 1 +
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 9b52aa8..d70565a 100644
---
2008 Oct 22
1
BUG: Bad passwords from Vampire / NT migration
> 3. The only evidence of any problem from the vampire command is the
> events logged on the PDC, and the invalid passwords. I tried
> deleting the trust account on the PDC and rejoining several times,
> with Samba on, off, and nmbd on and off. The result is always the
> same. The bad password hashes are always the same for each account.
> If I change a password on the PDC
2017 Aug 03
9
[PATCH 0/6] tests: Fix handling of device API parameters (RHBZ#1477623).
https://bugzilla.redhat.com/show_bug.cgi?id=1477623
The first two patches are cleanups.
The third patch changes the way that we handle Device and Dev_or_Path
parameters so that a parameter marked as such can really only contain
a block device name (and not, for instance, a chardev). Using a
chardev here caused hangs in the API.
The next two patches fix API usage to conform to this new stricter
2010 May 08
19
mb_chars.upcase and Ruby 1.9.2
I''m testing ruby-head through rvm but can''t get ''ação''.mb_chars.upcase
== ''AÇÃO''... I get ''AçãO'' instead...
This happens both for Rails 2.3.5 and Rails 3 beta 3...
How can I get upcase to work correctly?
Thanks in advance,
Rodrigo.
--
You received this message because you are subscribed to the Google Groups "Ruby
2016 Feb 23
4
[PATCH v3 0/4] [FOR COMMENTS ONLY] Rework inspection.
Previously posted:
https://www.redhat.com/archives/libguestfs/2015-December/msg00038.html
Inspection now really succeeds on a small number of simple guests.
To test it out:
$ ./run guestfish -v -x -a /tmp/centos-6.img
><fs> run
><fs> debug sh "guestfs-inspection --verbose"
Rich.
2015 Dec 05
6
[PATCH 0/6 v2] [FOR COMMENTS ONLY] Rework inspection.
This is a more working version. Inspection (partially) succeeds on a
real guest this time :-)
You can test it out on a real guest (in this case, a CentOS disk image
located at /tmp/centos-6.img) by doing:
$ ./run guestfish -v -x -a /tmp/centos-6.img
><fs> run
><fs> debug sh "guestfs-inspection --verbose"
which will print lots of debugging, and at the end the
2016 Jan 21
8
[PATCH v3 0/6] [FOR COMMENTS ONLY] Rework inspection.
For background on this change, see:
https://rwmj.wordpress.com/2015/12/06/inspection-now-with-added-prolog/
v2 was previously posted here:
https://www.redhat.com/archives/libguestfs/2015-December/msg00038.html
To test this patch series on a real guest, you can do:
$ ./run guestfish -v -x -a /var/tmp/centos-6.img
><fs> run
><fs> debug sh "guestfs-inspection
2014 Feb 25
2
[PATCH supermin v4] Supermin 5 rewrite.
...st void *p2)
-{
- const char *s1 = * (char * const *) p1;
- const char *s2 = * (char * const *) p2;
-
- /* Note, arguments are reversed to achieve a reverse sort. */
- return filevercmp (s2, s1);
-}
-
-void
-add_string (char ***argv, size_t *n_used, size_t *n_alloc, const char *str)
-{
- char *new_str;
-
- if (*n_used >= *n_alloc)
- *argv = x2nrealloc (*argv, n_alloc, sizeof (char *));
-
- if (str)
- new_str = xstrdup (str);
- else
- new_str = NULL;
-
- (*argv)[*n_used] = new_str;
-
- (*n_used)++;
-}
-
-size_t
-count_strings (char *const *argv)
-{
- size_t argc;
-
- for (argc...